/* Theme 4: แบบเว็บเดิม (ktp) — the look of the old district websites (atomy "ktp" template), owner 2026-12-03.
   Recreated in CSS from the old template's shapes (no old images or code): blue block title bars with the
   orange corner and white stripes, thin blue frames, solid blue menu items with a white arrow, a white top
   bar and a blue footer. Colours follow the site's own primary/accent colours ("น้ำเงิน-ส้ม (แบบเว็บเดิม)"
   matches the old blue and orange); spacing and text sizes stay at the new, easier-to-read values. */
body.theme-ktp-classic {
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --surface-bg: #ececec;
    background-color: var(--surface-bg);
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, .025) 0 2px, transparent 2px 6px);
}

/* top bar: white with blue links, like HOME | NEWS | ADMIN */
body.theme-ktp-classic .top-utility-bar { background: #fff; color: #334155; border-bottom: 1px solid #d9dee7; }
body.theme-ktp-classic .top-utility-bar a { color: var(--brand-primary); font-weight: 600; }

/* main navigation: solid blue bar with a lighter band, as the old menu image */
body.theme-ktp-classic .site-nav {
    background: linear-gradient(180deg, var(--brand-primary) 0 50%, color-mix(in srgb, var(--brand-primary) 82%, #fff) 50% 100%);
    border-top: 3px solid var(--brand-accent);
}

/* blocks: thin blue frame, rounded top-right corner, orange mark at the bottom right */
body.theme-ktp-classic .panel-box {
    border: 1px solid var(--brand-primary);
    border-radius: 2px 14px 10px 10px;
    box-shadow: none;
}
body.theme-ktp-classic .panel-box::after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: -1px;
    width: 64px;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-accent) 0 78%, transparent 78% 84%, color-mix(in srgb, var(--brand-accent) 50%, #fff) 84% 100%);
    border-radius: 2px 2px 0 0;
    pointer-events: none;
}

/* block title bar: blue band, orange bar + white arrow on the left, orange corner and white stripes on the right */
body.theme-ktp-classic .panel-head {
    position: relative;
    margin: -18px -18px 14px;
    padding: 13px 16px 11px 40px;
    min-height: 44px;
    border-bottom: 0;
    border-radius: 1px 13px 0 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 9'%3E%3Cg fill='%23fff' fill-opacity='.85'%3E%3Cpath d='M0 9L4.2 0H11.2L7 9Z'/%3E%3Cpath d='M20 9L24.2 0H31.2L27 9Z'/%3E%3Cpath d='M40 9L44.2 0H51.2L47 9Z'/%3E%3C/g%3E%3C/svg%3E") right 58px top 0 / 60px 9px no-repeat,
        var(--brand-primary);
    overflow: hidden;
}
body.theme-ktp-classic .panel-head::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 18'%3E%3Cpath d='M0 0L10 9L0 18Z' fill='%23fff'/%3E%3C/svg%3E") 8px 0 / 10px 18px no-repeat,
        linear-gradient(var(--brand-accent), var(--brand-accent)) 0 0 / 5px 100% no-repeat;
}
body.theme-ktp-classic .panel-head::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 64px;
    height: 9px;
    background: var(--brand-accent);
    clip-path: polygon(4.2px 0, 100% 0, 100% 100%, 0 100%);
    border-top-right-radius: 13px;
    pointer-events: none;
}
/* white on the blue band, also for blocks that colour their own title (e.g. OIT/ITA) */
body.theme-ktp-classic .panel-head h2 { color: #fff !important; font-size: 16px; }
/* narrow side columns: a little less padding and the side-column title size, so titles that fit stay on one line */
body.theme-ktp-classic .portal-col-side .panel-head { padding-left: 34px; padding-right: 12px; }
body.theme-ktp-classic .portal-col-side .panel-head h2 { font-size: 15px; }
body.theme-ktp-classic .panel-head .panel-more,
body.theme-ktp-classic .panel-head a { color: #fff; }
body.theme-ktp-classic .panel-head .panel-more { text-decoration: underline; text-underline-offset: 3px; }
body.theme-ktp-classic .split-2-grid .panel-head { margin: -14px -14px 12px; border-radius: 9px 9px 0 0; }
/* blocks with their own title image (.panel-head-banner*) keep that image */

/* menu blocks: solid blue items with a white arrow; hover lighter blue with an orange arrow */
body.theme-ktp-classic .side-menu-list { gap: 3px; }
body.theme-ktp-classic .side-menu-list a,
body.theme-ktp-classic .side-menu-toggle {
    position: relative;
    padding: 8px 10px 8px 26px;
    border-radius: 2px;
    background: var(--brand-primary);
    border: 0;
    color: #fff;
    font-weight: 600;
}
body.theme-ktp-classic .side-menu-list a::before,
body.theme-ktp-classic .side-menu-toggle::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    border: 5px solid transparent;
    border-left: 7px solid #fff;
    border-right: 0;
    transform: translateY(-50%);
}
body.theme-ktp-classic .side-menu-list a:hover,
body.theme-ktp-classic .side-menu-toggle:hover,
body.theme-ktp-classic .side-menu-toggle[aria-expanded="true"] {
    background: color-mix(in srgb, var(--brand-primary) 78%, #fff);
    color: #fff;
}
body.theme-ktp-classic .side-menu-list a:hover::before,
body.theme-ktp-classic .side-menu-toggle:hover::before { border-left-color: var(--brand-accent); }
body.theme-ktp-classic .side-menu-list a:focus-visible,
body.theme-ktp-classic .side-menu-toggle:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 1px; }
/* menu items and sub-menu headings use the white arrow instead of their icon (a theme-colour icon disappears on the blue band) */
body.theme-ktp-classic .side-menu-list a .sc-icon,
body.theme-ktp-classic .side-menu-toggle .sc-icon { display: none; }
body.theme-ktp-classic .side-menu-toggle .side-menu-caret { color: #fff; }
body.theme-ktp-classic .side-menu-list a * { color: inherit; }
/* third level (items under a sub-menu) stay light so the levels can be told apart */
/* third level: thin list with a blue guide line and an orange square, no boxes, so names stay on one line (owner chose "แบบ ก" 2026-12-04) */
body.theme-ktp-classic .side-sub-list { margin: 3px 0 2px 10px; padding: 0; border-left: 2px solid var(--brand-primary); gap: 0; }
body.theme-ktp-classic .side-menu-list .side-sub-list a {
    padding: 5px 6px 5px 16px;
    min-height: 24px;
    background: transparent;
    color: var(--brand-primary-dark);
    font-weight: 500;
    border-radius: 0;
}
body.theme-ktp-classic .side-menu-list .side-sub-list a::before {
    left: 6px;
    width: 5px;
    height: 5px;
    border: 0;
    background: var(--brand-accent);
}
body.theme-ktp-classic .side-menu-list .side-sub-list a:hover { background: #eef3fc; color: var(--brand-primary-dark); text-decoration: underline; }
body.theme-ktp-classic .side-menu-list .side-sub-list a:hover::before { background: var(--brand-accent); }

/* footer: blue band with an orange line, as the old site */
body.theme-ktp-classic .site-footer {
    background: var(--brand-primary-dark);
    color: #e2e8f0;
    border-top: 4px solid var(--brand-accent);
}
body.theme-ktp-classic .site-footer a { color: #fff; }
