/* Ashfall branding over the supplied Metin2CMS 2.12 layout. */
:root {
    --ashfall-ink: #eadccb;
    --ashfall-paper: #241c16;
    --ashfall-red: #873d28;
    --ashfall-red-hover: #a44f30;
    --ashfall-gold: #deb975;
    --ashfall-night: #16120e;
}
html { background: var(--ashfall-night); }
body.ashfall-theme {
    margin: 0;
    min-width: 320px;
    color: var(--ashfall-ink);
    background-color: var(--ashfall-night);
    background-image: linear-gradient(to bottom, #16120e08 28%, var(--ashfall-night) 100%), url('../images/ashfall-battle-background.webp');
    background-position: center top;
    background-size: 100% auto;
    background-repeat: no-repeat;
    overflow-wrap: anywhere;
}
.ashfall-theme .page-width { width: min(1100px, calc(100% - 48px)); }
.ashfall-theme .main-hd .page-width { min-height: 470px; }
.ashfall-theme .main-hd .ashfall-brand {
    top: 74px;
    left: 50%;
    width: min(650px, 72%);
    height: auto;
    margin: 0;
    transform: translateX(-50%);
    background: none;
}
.ashfall-theme .ashfall-brand a { display: block; width: 100%; height: auto; }
.ashfall-theme .ashfall-brand img { display: block; width: 100%; height: auto; }
.ashfall-theme .main-hd .main {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 64px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 28px;
    margin: 0;
    padding: 6px 20px;
    background: #24150fe8;
    border-block: 1px solid #96764b;
    font-size: 21px;
}
.ashfall-theme .main-hd .main > .menu-item { margin: 0; }
.ashfall-theme .main-hd .main a { display: block; padding: 12px 2px; color: #fff0cd; }
.ashfall-theme .main-hd .main a:hover { color: #f5c978; }
.ashfall-theme .main-hd .external {
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0 18px;
    width: 100%;
    height: auto;
    margin: 0;
}
.ashfall-theme .main-hd .external li,
.ashfall-theme .main-hd .external li:first-child,
.ashfall-theme .main-hd .external li:last-child {
    padding: 0;
    height: auto;
    background: none;
}
.ashfall-theme .main-hd .external a { min-height: 44px; padding: 14px 0 8px; background: none; color: #ffe3b1; }
.ashfall-theme .main-hd .sub-menu {
    top: 100%;
    left: -20px;
    padding: 8px 18px;
    width: max-content;
    min-width: 170px;
    background: #2b1a12;
    border: 1px solid #96764b;
    z-index: 20;
}
.ashfall-theme .main-hd .sub-menu:after { content: none; }
.ashfall-theme .main-hd .sub-menu a { margin: 0; padding: 10px 4px; font-size: 17px; }
.ashfall-theme .main-hd .menu-item:focus-within > .sub-menu { display: block; }
.ashfall-theme #content:after { content: none; }
.ashfall-theme .article .page-bd {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 278px;
    gap: 38px;
    min-height: 500px;
    padding: 34px 38px 42px;
    margin: 0;
    overflow: visible;
    background: var(--ashfall-paper);
    box-shadow: 0 18px 52px #0009;
}
.ashfall-theme .article .mt2cms2-c-l,
.ashfall-theme .article .mt2cms2-c-s { float: none; width: auto; min-width: 0; margin-top: 0; }
.ashfall-theme .article .mt2cms2-c-l .bd-c,
.ashfall-theme .article .mt2cms2-c-s .bd-c { margin-inline: 0; }
.ashfall-theme .article .page-bd .page-hd { padding-top: 0; min-height: 130px; background-size: cover; background-position: center; }
.ashfall-theme .article h2 { width: auto; max-width: 100%; font-size: 40px; padding-top: 24px; }
.ashfall-theme .article .mt2cms2-c-l .blog-title { font-size: 30px; }
.ashfall-theme .article p { max-width: 70ch; }
.ashfall-theme .article .blog-attribution { color: #c6ae97; }
.ashfall-theme .article a { color: #efbc78; }
.ashfall-theme .article a:hover { color: #ffe1ac; }
.ashfall-theme .widget .bd { border: 1px solid #786047; border-radius: 0; box-shadow: none; background: #30261e; }
.ashfall-theme .mod-main { background: none; }
.ashfall-theme .top-sidebar { padding: 12px 8px; background: var(--ashfall-red); color: #fff0d5; }
.ashfall-theme .article .mt2cms2-c-s h4 { margin: 0; white-space: normal; font-size: 23px; }
.ashfall-theme .form-control { height: 44px; border-color: #947554; border-radius: 1px; background: #17130f; color: #f4e6d3; }
.ashfall-theme .form-control::placeholder { color: #bba78f; opacity: 1; }
.ashfall-theme .btn { min-height: 44px; padding: 10px 18px; border-radius: 1px; }
.ashfall-theme .btn-success,
.ashfall-theme .btn-primary { background: var(--ashfall-red); border-color: var(--ashfall-red); color: #fff0d5; }
.ashfall-theme .article .btn-success,
.ashfall-theme .article .btn-primary { color: #fff0d5; }
.ashfall-theme .btn-success:hover,
.ashfall-theme .btn-primary:hover { background: var(--ashfall-red-hover); border-color: var(--ashfall-red-hover); }
.ashfall-theme .btn:disabled { opacity: .65; cursor: not-allowed; }
.ashfall-theme .widget hr { margin: 14px 12px; border-color: #786047; }
.ashfall-theme .nav-tabs .nav-link { min-width: 48px; min-height: 44px; }
.ashfall-theme .footer-nav { margin-top: 0; padding-block: 30px; color: #d6bd99; background: #16120e; }
.ashfall-theme .footer-nav:before { content: none; }
.ashfall-theme .footer-nav a { color: #e6c58d; }
.ashfall-theme .footer-nav .page-padding { margin: 0; }
.ashfall-theme .footer-nav .row { margin-inline: 0; }
.ashfall-theme ::selection { background: #712b21; color: #fff0d5; }
.ashfall-theme input { caret-color: #efbc78; }
.ashfall-theme :focus-visible { outline: 2px solid #b15816; outline-offset: 3px; }
.ashfall-theme table { font-variant-numeric: tabular-nums; }
@media (max-width: 800px) {
    body.ashfall-theme { background-size: auto 780px; }
    .ashfall-theme .page-width { width: calc(100% - 24px); }
    .ashfall-theme .main-hd .page-width { min-height: 390px; }
    .ashfall-theme .main-hd .ashfall-brand { top: 92px; width: min(580px, 94%); }
    .ashfall-theme .main-hd .main { gap: 0 18px; font-size: 18px; padding-inline: 8px; }
    .ashfall-theme .article .page-bd { grid-template-columns: minmax(0, 1fr); padding: 24px; gap: 26px; }
    .ashfall-theme .article .mt2cms2-c-s { display: grid; grid-template-columns: minmax(0, 1fr); }
    .ashfall-theme .article h2 { font-size: 34px; }
    .ashfall-theme .article .mt2cms2-c-l .blog-title { font-size: 27px; }
    .ashfall-theme .main-hd .sub-menu { left: auto; right: 0; }
    .ashfall-theme .footer-nav .col-md-4 p { text-align: left !important; }
}
@media (max-width: 420px) {
    .ashfall-theme .main-hd .page-width { min-height: 355px; }
    .ashfall-theme .main-hd .ashfall-brand { top: 96px; }
    .ashfall-theme .main-hd .main { gap: 0 14px; font-size: 17px; }
    .ashfall-theme .article .page-bd { padding: 18px; }
}

/* Keep CMS pages within their grid column and replace the fixed legacy pager. */
.ashfall-theme .article .container { width: 100%; max-width: 100%; box-sizing: border-box; }
.ashfall-theme .wp-pagenavi { margin: 0 0 24px; padding: 0; background: none; max-width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.ashfall-theme .wp-pagenavi a, .ashfall-theme .wp-pagenavi .current { margin: 0; padding: 8px 12px; min-width: 40px; width: auto; height: auto; line-height: 1.3; border: 1px solid #bba685; background: none; color: #efbc78; }
.ashfall-theme .wp-pagenavi .current { color: #fff0d5; background: var(--ashfall-red); }
.ashfall-theme textarea.form-control { height: auto; min-height: 180px; }
.ashfall-theme form > label { display: block; }

/* Local language selector: keyboard/touch support without a tall hover menu. */
.ashfall-theme .ashfall-language-form { margin: 0; }
.ashfall-theme .ashfall-language-select {
    max-width: 220px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #96764b;
    border-radius: 1px;
    background-color: #2b1a12;
    color: #fff0cd;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    cursor: pointer;
}
.ashfall-theme .ashfall-language-select option { background: #2b1a12; color: #fff0cd; }
.ashfall-theme .ashfall-language-menu { min-width: 0; }

/* Ashfall battle artwork, matched lettering, and warm news surfaces. */
.ashfall-theme .ashfall-brand .ashfall-tagline {
    width: 82%;
    height: 64px;
    margin: -12px auto 0;
    object-fit: cover;
    object-position: center;
}
.ashfall-theme .article .page-bd {
    border-top: 1px solid #99754c;
}
.ashfall-theme .article h2,
.ashfall-theme .article h3,
.ashfall-theme .article h4 { color: #f0d3a6; }
.ashfall-theme .article .page-bd .ashfall-news-banner {
    min-height: 190px;
    height: auto;
    margin: 0 0 30px;
    display: flex;
    align-items: flex-end;
    background-position: center;
}
.ashfall-theme .article .page-bd .ashfall-news-banner:before { content: none; }
.ashfall-theme .article .page-bd .ashfall-news-banner .bd-c { width: 100%; padding: 70px 24px 22px; }
.ashfall-theme .article .page-bd .ashfall-news-banner h2 {
    margin: 0;
    padding: 0;
    color: #fff2dc;
    text-shadow: 0 2px 8px #000;
}
.ashfall-theme .article .blog-post {
    background: none;
    border-bottom: 1px solid #68513e;
}
.ashfall-theme .article .table { color: #eadccb; }
.ashfall-theme .table td, .ashfall-theme .table th { border-color: #68513e; }
.ashfall-theme .table-striped tbody tr:nth-of-type(odd) { background-color: #ffffff06; }
.ashfall-theme .table-hover tbody tr:hover { background-color: #ffffff0c; }
.ashfall-theme .nav-tabs { border-color: #786047; }
.ashfall-theme .nav-tabs .nav-link.active { background: #30261e; border-color: #786047; color: #f2d7ae; }
.ashfall-theme .article .list-group-item { background: #30261e; border-color: #68513e; color: #eadccb; }
@media (max-width: 800px) {
    .ashfall-theme .ashfall-brand .ashfall-tagline { height: 56px; margin-top: -8px; }
    .ashfall-theme .article .page-bd .ashfall-news-banner { min-height: 165px; }
    .ashfall-theme .article .page-bd .ashfall-news-banner .bd-c { padding: 65px 20px 20px; }
}
@media (max-width: 420px) {
    .ashfall-theme .ashfall-brand .ashfall-tagline { width: 92%; height: 42px; margin-top: -8px; }
    .ashfall-theme .article .page-bd .ashfall-news-banner { min-height: 145px; }
    .ashfall-theme .article .page-bd .ashfall-news-banner .bd-c { padding: 50px 16px 18px; }
}

@media (max-width: 420px) { .ashfall-theme .main-hd .page-width { min-height: 380px; } }
.ashfall-theme .wp-pagenavi .current { color: #fff0d5 !important; }
.ashfall-theme input { caret-color: #efbc78; }

/* Show the battle before the reading surface; finish every page with a temple scene. */
body.ashfall-theme { background-image: none; }
.ashfall-theme .main-hd {
    background-image: linear-gradient(to bottom, #16120e0a 65%, #16120e 100%), url('../images/ashfall-battle-background.webp');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.ashfall-theme .main-hd .page-width { min-height: clamp(660px, 48vw, 900px); }
.ashfall-theme .main-hd .ashfall-brand { top: 54px; }
.ashfall-battle-scene { display: none; }
.ashfall-theme .article .page-bd { background: #241c16; }
.ashfall-theme .ashfall-footer .footer-nav {
    margin: 0;
    min-height: 390px;
    padding: 58px 0 26px;
    background-color: #16120e;
    background-image: linear-gradient(to bottom, #16120e 0%, #16120e60 28%, #16120e88 70%, #16120e 100%), url('../images/ashfall-footer-temple.jpg');
    background-position: center, center 43%;
    background-size: cover;
    background-repeat: no-repeat;
    border-top: 1px solid #8d6641;
    text-align: center;
}
.ashfall-theme .ashfall-footer-brand { display: block; width: 270px; max-width: 80%; margin: 0 auto 18px; }
.ashfall-theme .ashfall-footer-brand img { display: block; width: 100%; height: auto; }
.ashfall-theme .ashfall-footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 30px; margin: 0 auto 24px; }
.ashfall-theme .ashfall-footer-links a { display: block; padding: 12px 4px; min-height: 44px; font-family: Georgia, serif; font-size: 17px; color: #ffe1ac; text-shadow: 0 2px 5px #000; }
.ashfall-theme .ashfall-footer-links a:hover { color: #fff5e3; }
.ashfall-theme .ashfall-footer .social { float: none; width: auto; margin: 0 auto 18px; padding: 0; }
.ashfall-theme .ashfall-footer .social ul { justify-content: center; }
.ashfall-theme .ashfall-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-top: 20px; border-top: 1px solid #786047; color: #d8c8b4; }
.ashfall-theme .ashfall-footer-bottom small { font-size: 13px; }
.ashfall-theme .ashfall-footer-bottom a { color: #e7c18c; }
@media (max-width: 800px) {
    .ashfall-theme .main-hd { background-image: none; }
    .ashfall-theme .main-hd .page-width { min-height: calc(370px + 56.25vw); }
    .ashfall-theme .main-hd .ashfall-brand { top: 54px; width: min(480px, 94%); }
    .ashfall-battle-scene { display: block; position: absolute; top: clamp(220px, 35vw, 280px); left: 0; right: 0; }
    .ashfall-battle-scene img { display: block; width: 100%; height: auto; }
    .ashfall-theme .ashfall-footer .footer-nav { min-height: 360px; padding-top: 44px; background-position: center, center 40%; }
    .ashfall-theme .ashfall-footer-bottom { justify-content: center; }
    .ashfall-theme .ashfall-footer-links { gap: 0 22px; }
}
