/* Metin2 Wiki redesign home panels. */

.wiki-home {
    color: #21180e;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    --home-panel-title-row: 25px;
    --home-panel-text-row: 24px;
    --home-panel-icon-row: 28px;
    --home-panel-frame: #2f1d1f;
    --home-panel-surface: var(--m2-parchment, #f0d9a2);
    --home-panel-title-text: #f0d9a2;
}

.wiki-home a {
    text-decoration-thickness: auto;
    text-underline-offset: auto;
}

.wiki-home-page-heading {
    margin: 0 0 16px;
    border-bottom: 2px solid #9b271d;
}

.wiki-home-page-heading h1 {
    margin: 0;
    padding: 0;
    color: #211307;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.25;
}

.wiki-home-hero {
    width: 800px;
    max-width: 100%;
    margin: 0 auto 10px;
}

.wiki-home-hero img {
    display: block;
    width: 100%;
    height: auto;
}

.portal-panel {
    overflow: hidden;
    border: 1px solid var(--home-panel-frame);
    border-radius: 10px;
    background: var(--home-panel-surface);
    box-shadow: 2px 2px 5px #000;
}

.portal-panel > h2 {
    display: block;
    min-height: var(--home-panel-title-row);
    margin: 0;
    padding: 0 8px;
    border-bottom: 0;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    background: var(--home-panel-frame);
    color: var(--home-panel-title-text);
    font-family: Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: var(--home-panel-title-row);
    text-align: center;
    text-shadow: 1px 1px 2px #000;
}

.portal-classes {
    margin-bottom: 10px;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--home-panel-surface);
}

.class-card {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 150px;
    gap: 4px 5px;
    padding: 5px 5px 5px 0;
    border-right: 1px solid #5d3210;
}

.class-card:last-child {
    border-right: 0;
}

.class-portraits {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 6px;
    grid-column: 1;
    grid-row: 2;
}

.class-portraits img {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.class-name {
    align-self: start;
    justify-self: center;
    grid-column: 1;
    grid-row: 1;
    color: #24180d;
    font-weight: inherit;
    line-height: 25px;
    text-align: center;
    text-decoration: underline;
}

.class-name--disabled {
    cursor: default;
    opacity: 0.72;
    text-decoration: none;
}

.class-links {
    display: grid;
    align-content: start;
    gap: 0;
    grid-auto-rows: minmax(var(--home-panel-icon-row), auto);
    grid-column: 2;
    grid-row: 1 / span 2;
}

.class-links .wiki-icon-link {
    min-height: var(--home-panel-icon-row);
    line-height: var(--home-panel-icon-row);
}

.wiki-icon-link {
    display: inline-block;
    min-width: 0;
    min-height: 0;
    color: #24180d;
    font-weight: inherit;
    line-height: var(--home-panel-text-row);
    text-decoration: none;
    white-space: nowrap;
    transition: color 140ms ease;
}

.wiki-icon-link:hover,
.wiki-icon-link:focus-visible {
    color: #8f2615;
    text-decoration: none;
}

.wiki-icon-link--disabled,
.wiki-icon-link--disabled:hover {
    color: #24180d;
    cursor: default;
}

.wiki-icon-link > span:last-child {
    text-decoration: underline;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
}

.wiki-icon-link:hover > span:last-child,
.wiki-icon-link:focus-visible > span:last-child {
    text-decoration: none;
}

.wiki-icon-link--disabled > span:last-child,
.wiki-icon-link--disabled:hover > span:last-child {
    text-decoration: none;
}

.wiki-icon-link img {
    margin-right: 6px;
    vertical-align: middle;
}

.wiki-icon-link-item-slot {
    display: inline-flex;
    width: 20px;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    vertical-align: middle;
}

.wiki-icon-link-item-slot--size-2 {
    height: 40px;
}

.wiki-icon-link-item-slot--size-3 {
    height: 60px;
}

.wiki-icon-link-item-slot--size-4 {
    height: 80px;
}

.wiki-icon-link-item-slot > img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
}

.wiki-home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 5px;
}

.wiki-home-grid .portal-panel {
    min-width: 0;
}

.wiki-home-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 10px;
    min-width: 0;
}

.world-map-image {
    display: block;
    width: 260px;
    max-width: calc(100% - 36px);
    height: auto;
    margin: 9px auto 6px;
}

.kingdom-table {
    width: calc(100% - 34px);
    margin: 0 auto 6px;
    border-collapse: collapse;
    color: #21180e;
    font-size: 11px;
    text-align: center;
}

.kingdom-table th,
.kingdom-table td {
    padding: 2px 5px;
    border: 0;
    font-weight: inherit;
}

.kingdom-table th img {
    vertical-align: -1px;
}

.kingdom-table a {
    color: #24180d;
    text-decoration: underline;
    transition: color 140ms ease, text-decoration-color 140ms ease;
}

.kingdom-table a:hover,
.kingdom-table a:focus-visible {
    color: #8f2615;
    text-decoration: none;
}

.kingdom-table tr:first-child th:nth-child(2),
.kingdom-table tr:nth-child(n + 2) td:nth-child(2) {
    background: #d0a447;
}

.kingdom-table tr:first-child th:nth-child(3),
.kingdom-table tr:nth-child(n + 2) td:nth-child(3) {
    background: #78a7ce;
}

.kingdom-table tr:first-child th:nth-child(4),
.kingdom-table tr:nth-child(n + 2) td:nth-child(4) {
    background: #9a2015;
}

.map-section-title {
    display: block;
    width: calc(100% - 48px);
    min-height: 25px;
    margin: 6px auto 4px;
    padding: 3px 10px;
    border: 1px solid var(--home-panel-title-text);
    border-radius: 8px;
    background: var(--home-panel-frame);
    color: var(--home-panel-title-text);
    font-family: Tahoma, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 2px 3px 7px rgba(20, 8, 2, 0.36);
}

.wiki-link-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 0 10px 3px;
}

.wiki-link-columns a {
    display: flex;
    min-height: var(--home-panel-text-row);
    align-items: center;
    min-width: 0;
    color: #24180d;
    line-height: 1.4;
    text-decoration: underline;
    transition: color 140ms ease, transform 140ms ease, text-decoration-color 140ms ease;
    overflow-wrap: anywhere;
}

.wiki-link-columns a:hover,
.wiki-link-columns a:focus-visible {
    color: #8f2615;
    text-decoration: none;
    transform: translateX(1px);
}

.quick-panel h3:not(.sr-only) {
    margin: 8px 0 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #21180e;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-shadow: none;
    box-shadow: none;
}

.portal-link-section {
    padding: 8px 0;
}

.portal-link-section + .portal-link-section::before {
    display: block;
    width: min(62%, 230px);
    height: 1px;
    margin: 0 auto 10px;
    border-top: 1px solid rgba(170, 111, 42, 0.68);
    border-bottom: 1px solid rgba(255, 239, 178, 0.75);
    content: "";
}

.portal-link-grid {
    display: grid;
    row-gap: 0;
    column-gap: 14px;
    padding: 0 10px;
}

.portal-link-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-link-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 9px;
}

.managed-home-panel--top-buttons {
    margin-bottom: 10px;
}

.portal-link-grid--top {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 7px 0;
}

.portal-link-grid--top .wiki-icon-link {
    position: relative;
    display: flex;
    width: 12.5%;
    min-width: 0;
    max-width: 12.5%;
    flex: 0 0 12.5%;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 2px 9px;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.portal-link-grid--top .wiki-icon-link:not(:last-child)::after {
    position: absolute;
    top: 4px;
    right: 0;
    bottom: 4px;
    width: 1px;
    background: rgba(86, 48, 22, 0.72);
    box-shadow: 1px 0 rgba(255, 236, 177, 0.58);
    content: "";
}

.portal-link-grid--top .wiki-icon-link > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.portal-link-grid--top .wiki-icon-link img {
    display: block;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    margin: 0 7px 0 0;
}

.portal-link-grid--top .wiki-icon-link img[src*="/mob_icon.php"] {
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

.portal-link-grid--top .wiki-icon-link-item-slot,
.portal-link-grid--top .wiki-icon-link-item-slot--size-2,
.portal-link-grid--top .wiki-icon-link-item-slot--size-3,
.portal-link-grid--top .wiki-icon-link-item-slot--size-4 {
    width: 34px;
    min-width: 34px;
    height: 34px;
    margin: 0 7px 0 0;
}

.portal-link-grid--top .wiki-icon-link-item-slot > img {
    margin: 0;
}

.quick-panel .wiki-icon-link {
    display: inline-flex;
    min-height: var(--home-panel-icon-row);
    align-items: center;
    line-height: var(--home-panel-icon-row);
}

.portal-link-grid .wiki-icon-link {
    min-height: var(--home-panel-icon-row);
    line-height: var(--home-panel-icon-row);
}

.quick-panel .portal-link-grid--two .wiki-icon-link:nth-child(even) {
    justify-self: end;
    text-align: right;
}

.quick-panel .wiki-icon-link--icon-left img {
    order: 0;
    margin-right: 6px;
    margin-left: 0;
}

.quick-panel .wiki-icon-link--icon-left .wiki-icon-link-item-slot {
    order: 0;
    margin-right: 6px;
    margin-left: 0;
}

.quick-panel .wiki-icon-link--icon-right img {
    order: 2;
    margin-right: 0;
    margin-left: 6px;
}

.quick-panel .wiki-icon-link--icon-right .wiki-icon-link-item-slot {
    order: 2;
    margin-right: 0;
    margin-left: 6px;
}

.quick-panel .wiki-icon-link .wiki-icon-link-item-slot > img {
    order: 0;
    margin: 0;
}

.portal-link-grid--three .wiki-icon-link {
    font-size: 11px;
}

.image-link-list {
    display: grid;
    gap: 10px;
    padding: 9px 8px 11px;
}

.image-link-card {
    display: block;
    color: #000;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
}

.image-link-card-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto 7px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.image-link-card strong {
    display: block;
    color: #000;
    font-weight: 700;
    text-decoration: underline;
}

.image-link-card span {
    display: block;
    max-width: 100%;
    margin-top: 3px;
    color: #000;
    font-weight: 400;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
}

.image-link-card:hover strong,
.image-link-card:focus-visible strong {
    color: #8f2615;
    text-decoration: none;
}

@media (max-width: 860px) {
    .portal-link-grid--top {
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-color: rgba(86, 48, 22, 0.72) rgba(255, 236, 177, 0.42);
        scrollbar-width: thin;
    }

    .portal-link-grid--top .wiki-icon-link {
        width: 118px;
        min-width: 118px;
        max-width: none;
        flex-basis: 118px;
    }

    .quick-panel .portal-link-grid--two .wiki-icon-link:nth-child(even) {
        justify-self: start;
        text-align: left;
    }

}

.wiki-home-side {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.portal-search-results {
    margin: 0 0 16px;
    padding: 24px 26px 10px;
    background: transparent;
}

.portal-search-results-head {
    margin: 0 0 14px;
    padding: 0 0 7px;
    border-bottom: 2px solid #990000;
}

.portal-search-results-head h1 {
    margin: 0;
    color: #000;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.08;
    text-shadow: none;
}

.portal-search-results .result-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-content: start;
    gap: 24px;
    min-height: 0;
    padding: 0 0 12px;
}

.portal-search-result-group {
    min-width: 0;
}

.portal-search-result-group h3 {
    margin: 0 0 8px;
    color: #21180e;
    font-size: 14px;
}

.portal-search-empty {
    margin: 0 0 12px;
    color: #6c5a42;
}

.portal-search-result-list {
    max-height: min(420px, 55vh);
    margin: 0;
    padding: 0 8px 0 0;
    overflow-y: auto;
    list-style: none;
    overscroll-behavior: contain;
    scrollbar-color: #990000 #ead69e;
    scrollbar-width: thin;
}

.portal-search-result-list::-webkit-scrollbar {
    width: 10px;
}

.portal-search-result-list::-webkit-scrollbar-track {
    background: #ead69e;
}

.portal-search-result-list::-webkit-scrollbar-thumb {
    border: 2px solid #ead69e;
    border-radius: 999px;
    background: #990000;
}

.portal-search-result-list li {
    margin: 0;
}

.portal-search-result-list li:not(:last-child) {
    border-bottom: 1px solid rgba(143, 106, 71, 0.45);
}

.portal-search-results .compact-row {
    display: flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    color: #21180e;
    line-height: 1.25;
    text-decoration: none;
}

.portal-search-results .compact-row:hover,
.portal-search-results .compact-row:focus-visible {
    background: rgba(255, 242, 195, 0.42);
}

.portal-search-results .compact-row > img {
    flex: 0 0 auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.portal-search-results .compact-row > span {
    min-width: 0;
}

.portal-search-results .compact-row strong,
.portal-search-results .compact-row small {
    display: block;
    overflow-wrap: anywhere;
}

.portal-search-results .compact-row strong {
    color: #21180e;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.portal-search-results .compact-row small {
    margin-top: 2px;
    color: #6c5a42;
}

.portal-search-results::after {
    display: block;
    height: 2px;
    margin-top: 8px;
    background: #990000;
    content: "";
}
