/* ThaiCPD Responsive – Joomla 1.5 template
   สีหลัก: กระดาษ #F6F2EA · กรมท่า #1F3A5F · ส้ม #B8541B */
:root{--bg:#F6F2EA;--surface:#fff;--line:#E4DDD0;--fg:#1B2433;--muted:#4A5462;--ink:#10233D;--brand:#1F3A5F;--brand-soft:#E6ECF4;--accent:#B8541B;--red:#C8201A;--warn-bg:#FFF4E8;--warn-line:#F0C9A3;--warn-fg:#7A3410;--band:#10233D}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body.tc{margin:0;background:#F6F2EA;color:#1B2433;font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:16px;line-height:1.65}
.tc a{color:#1F3A5F}
.tc a:hover{color:#B8541B}
.tc img{max-width:100%;height:auto}
.tc h1,.tc h2,.tc h3,.tc .contentheading,.tc .componentheading{font-family:'Noto Serif Thai',Georgia,serif;color:#10233D;line-height:1.35}
.tc-wrap{max-width:1200px;margin:0 auto;padding-left:16px;padding-right:16px}

/* top bar + header */
.tc-topbar{background:#10233D;color:#C9D2DF;font-size:13px}
.tc-topbar .tc-wrap{display:flex;flex-wrap:wrap;gap:4px 20px;padding-top:7px;padding-bottom:7px}
.tc-topbar a{color:#F4B98A;text-decoration:none}
.tc-header{background:#fff;border-bottom:1px solid #E4DDD0;position:sticky;top:0;z-index:50}
.tc-header-in{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px}
.tc-logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:#10233D!important}
.tc-logo-mark{width:38px;height:38px;border-radius:9px;background:#1F3A5F;display:flex;align-items:center;justify-content:center}
.tc-logo b{font-family:'Noto Serif Thai',Georgia,serif;font-size:18px;white-space:nowrap}
.tc-logo b span{color:#C8201A}
.tc-header-btns{display:flex;gap:8px}
.tc-iconbtn{width:44px;height:44px;border-radius:10px;border:1px solid #E4DDD0;background:#fff;color:#1B2433;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}

/* top menu (user3 – mod_mainmenu legacy/list) */
.tc-topmenu{display:none}
.tc-topmenu ul,.tc-drawer-topmenu ul{list-style:none;margin:0;padding:0}
.tc-topmenu ul{display:flex;flex-wrap:wrap;gap:4px 18px}
.tc-topmenu a,.tc-topmenu a.mainlevel{color:#1B2433;text-decoration:none;font-weight:500;font-size:15px;padding:6px 0;display:inline-block;background:none}
.tc-topmenu a:hover,.tc-topmenu #active_menu{color:#B8541B}

/* banner */
.tc-banner{margin-top:16px;border:1px solid #E4DDD0;border-radius:12px;overflow:hidden;background:#fff}
.tc-banner img{display:block;width:100%;height:auto}
.tc-banner-cap{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;display:flex;flex-wrap:wrap;justify-content:space-between;gap:2px 16px;font-size:13px;color:#4A5462;padding:8px 2px 0}
.tc-breadcrumb{font-size:14px;margin-top:10px}

/* layout */
.tc-layout{display:block;margin-top:20px}
.tc-main{min-width:0}
.tc-content{background:#fff;border:1px solid #E4DDD0;border-radius:16px;padding:20px 16px;overflow-wrap:anywhere}
.tc-users{display:grid;gap:16px;margin-top:16px}

/* side column = drawer on phones */
.tc-side{position:fixed;top:0;bottom:0;left:0;width:86%;max-width:340px;background:#F6F2EA;z-index:100;overflow-y:auto;padding:16px;transform:translateX(-105%);transition:transform .2s ease;box-shadow:0 0 40px rgba(0,0,0,.25)}
.tc-drawer-open .tc-side{transform:none}
.tc-shade{display:none;position:fixed;inset:0;background:rgba(16,35,61,.45);z-index:90}
.tc-drawer-open .tc-shade{display:block}
.tc-drawer-topmenu{background:#fff;border:1px solid #E4DDD0;border-radius:14px;padding:6px 14px;margin-bottom:14px}
.tc-drawer-topmenu a{display:block;padding:11px 0;border-bottom:1px solid #E4DDD0;color:#1B2433;text-decoration:none;font-weight:500}
.tc-drawer-topmenu li:last-child a{border-bottom:0}

/* modules (style="xhtml" → div.moduletable > h3) */
.tc .moduletable,.tc .module{background:#fff;border:1px solid #E4DDD0;border-radius:14px;padding:16px;margin-bottom:16px}
.tc .moduletable h3,.tc .module h3{font-family:'IBM Plex Sans Thai',sans-serif;font-size:16px;color:#10233D;margin:0 0 10px}
.tc ul.menu{list-style:none;margin:0;padding:0}
.tc ul.menu li{margin:0;padding:0;background:none}
.tc ul.menu a{display:block;padding:10px 4px;border-bottom:1px solid #E4DDD0;color:#1B2433;text-decoration:none;font-size:15px}
.tc ul.menu li:last-child a{border-bottom:0}
.tc ul.menu a:hover,.tc ul.menu li.active a{color:#B8541B}

/* login module & all forms */
.tc form#form-login fieldset,.tc fieldset.input{border:0;margin:0;padding:0}
.tc form#form-login p{margin:0 0 10px}
.tc label{font-size:14px;font-weight:600;color:#4A5462}
.tc input.inputbox,.tc select.inputbox,.tc textarea.inputbox,.tc input[type=text],.tc input[type=password],.tc input[type=email],.tc textarea,.tc select{width:100%;max-width:100%;min-height:44px;padding:8px 12px;border:1px solid #CFC7B8;border-radius:10px;font:inherit;font-size:16px;background:#fff;color:#1B2433}
.tc input[type=checkbox],.tc input[type=radio]{width:auto;min-height:0}
.tc .button,.tc button.button,.tc input.button,.tc input[type=submit],.tc .validate{display:inline-block;min-height:44px;padding:8px 20px;border:0;border-radius:10px;background:#1F3A5F;color:#fff;font:inherit;font-weight:600;cursor:pointer}
.tc .button:hover,.tc input[type=submit]:hover{background:#B8541B}
.tc form#form-login ul{list-style:none;margin:8px 0 0;padding:0;font-size:14px}
.tc form#form-login ul li{padding:3px 0;background:none}

/* article output */
.tc .contentpaneopen{width:100%}
.tc .contentheading{font-size:24px;margin:0 0 10px}
.tc .componentheading{font-size:26px;margin:0 0 14px}
.tc .small,.tc .createdate,.tc .modifydate{font-size:13px;color:#4A5462}
.tc .pagenav,.tc .pagination{font-size:14px}
.tc table{max-width:100%;border-collapse:collapse}
.tc .tc-content table.contentpane,.tc .tc-content table.contentpaneopen{border:0}
.tc .sectiontableheader{background:#E6ECF4;color:#10233D;padding:8px}
.tc .sectiontableentry1 td,.tc .sectiontableentry2 td{padding:8px;border-bottom:1px solid #E4DDD0}
.tc .tc-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.tc iframe,.tc embed,.tc object,.tc video{max-width:100%}

/* system messages */
.tc #system-message{margin:0 0 16px;padding:0}
.tc #system-message dd ul{border-radius:10px}

/* footer + mobile bar */
.tc-footer{margin-top:48px;background:#0B1A2E;color:#AEB8C7;padding:28px 0 96px;font-size:15px}
.tc-footer .tc-wrap{display:flex;flex-direction:column;gap:6px}
.tc-footer a{color:#DCE5F0}
.tc-footer-name{font-family:'Noto Serif Thai',Georgia,serif;font-size:20px;color:#fff}
.tc-mbar{position:fixed;left:0;right:0;bottom:0;z-index:40;display:flex;gap:10px;background:#fff;border-top:1px solid #E4DDD0;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px))}
.tc-btn{flex:1;display:flex;align-items:center;justify-content:center;min-height:46px;border-radius:10px;font-weight:600;text-decoration:none;border:1px solid transparent}
.tc .tc-btn-accent{background:#B8541B;color:#fff}
.tc .tc-btn-line{border-color:#1E6B42;color:#1E6B42;background:#fff}

/* headings inside old content (CB / articles use h1 for body text) */
.tc .tc-content h1{font-family:'IBM Plex Sans Thai',sans-serif;font-size:20px;line-height:1.5}
.tc .tc-content h2{font-family:'IBM Plex Sans Thai',sans-serif;font-size:19px;line-height:1.5}
.tc .tc-content h3{font-family:'IBM Plex Sans Thai',sans-serif;font-size:17px;line-height:1.5}
.tc .tc-content .contentheading,.tc .tc-content .componentheading{font-family:'Noto Serif Thai',Georgia,serif}

/* ===== หน้าแรก (ใช้ใน article) ===== */
.tc-home-price{text-align:center}
.tc .tc-content .tc-home-price h1{font-family:'Noto Serif Thai',Georgia,serif;line-height:1.35;font-size:clamp(24px,4.6vw,38px);color:#2A2FC8;margin:0}
.tc-home-price h1 span{color:#10233D}
.tc-home-price h1 b{color:#C8201A;font-size:1.25em}
.tc-home-price p{margin:4px 0 0;color:#4A5462}
.tc-home-price p b{color:#C8201A}
.tc-icons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 10px;margin:22px 0 0}
.tc-icons a{display:flex;flex-direction:column;align-items:center;gap:8px;text-decoration:none;text-align:center;border-radius:16px;padding:8px 4px;color:#1F7894!important;font-size:15px;font-weight:600;line-height:1.35}
.tc-icons a:hover{background:#F6F2EA}
.tc-icons img{width:100%;max-width:120px;height:auto;display:block}
.tc-icons .tc-extra{grid-column:1/-1;margin-top:-6px;text-align:center;font-size:14px}
.tc .tc-content .tc-flow-h{font-family:'IBM Plex Sans Thai',sans-serif!important;font-size:clamp(20px,3.4vw,28px)!important;color:#2A2FC8!important;margin:40px 0 0}
.tc-flow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 0;padding:0;list-style:none}
.tc-flow li{position:relative;margin:0;padding:0;background:none}
.tc-flow a{display:flex;align-items:center;justify-content:center;text-align:center;min-height:62px;padding:8px 10px;background:#FFE45C;color:#1B1400!important;font-weight:700;border-radius:10px;text-decoration:none;font-size:15px;line-height:1.35}
.tc-ways{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:22px 0 0}
.tc-way{display:flex;flex-direction:column;gap:8px}
.tc-tile{position:relative;display:block;aspect-ratio:1/1;color:#fff!important;text-decoration:none;overflow:hidden;clip-path:polygon(0 0,100% 0,100% 100%,30% 100%,0 76%)}
.tc-tile img{position:absolute;left:7%;top:8%;width:46%;max-width:none}
.tc-tile .n{position:absolute;top:6%;right:7%;font-weight:700;font-size:clamp(34px,8vw,64px);line-height:1}
.tc-tile .t{position:absolute;right:7%;bottom:8%;text-align:right;line-height:1.15}
.tc-tile .t b{display:block;font-size:clamp(20px,4.6vw,36px)}
.tc-tile .t small{display:block;font-size:clamp(14px,3vw,24px)}
.tc-t1{background:#0A93CF}.tc-t2{background:#9C6C93}.tc-t3{background:#00893F}.tc-t4{background:#8B67C2}
.tc-way .links{display:flex;flex-direction:column;gap:2px;font-size:14px;text-align:center}
.tc-notice{margin:28px 0 0;background:#FFF4E8;border:1px solid #F0C9A3;border-radius:14px;padding:16px 18px;color:#7A3410}
.tc-notice b{display:block;font-size:17px;line-height:1.55}
.tc-notice p{margin:6px 0 0;font-size:15px}
.tc-box{background:#fff;border:1px solid #E4DDD0;border-radius:14px;padding:18px;margin:14px 0 0}
.tc-steps{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:10px}
.tc-steps li{background:#F6F2EA;border-radius:12px;padding:14px 16px;margin:0}
.tc-steps li b{color:#1F3A5F}
.tc-note{margin:12px 0 0;background:#10233D;color:#E6EAF0;border-radius:12px;padding:12px 16px;font-size:15px}
.tc-url{display:block;font-family:Consolas,monospace;font-size:13px;word-break:break-all;background:#F6F2EA;border-radius:8px;padding:8px 10px;margin-top:4px}

/* ===== tablet / desktop ===== */
@media (max-width:379px){.tc-logo b{font-size:16px}.tc-logo-mark{width:34px;height:34px}}
@media (min-width:720px){
	.tc-logo b{font-size:20px}
	.tc-content{padding:28px}
	.tc-users{grid-template-columns:repeat(2,minmax(0,1fr))}
	.tc-flow{grid-template-columns:repeat(4,minmax(0,1fr));gap:30px}
	.tc-flow li+li:before{content:"";position:absolute;left:-24px;top:50%;width:18px;height:18px;margin-top:-9px;background:#4A5462;clip-path:polygon(0 30%,55% 30%,55% 0,100% 50%,55% 100%,55% 70%,0 70%)}
	.tc-ways{gap:28px 40px}
	.tc-steps{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:1024px){
	.tc-topmenu{display:block}
	.tc-header-btns{display:none}
	.tc-layout.has-left{display:grid;grid-template-columns:260px minmax(0,1fr);gap:28px;align-items:start}
	.tc-layout.has-right{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:28px}
	.tc-layout.has-left.has-right{grid-template-columns:240px minmax(0,1fr) 240px}
	.tc-side{position:sticky;top:76px;transform:none;width:auto;max-width:none;box-shadow:none;padding:0;background:transparent;z-index:1;overflow:visible}
	.tc-drawer-topmenu,.tc-shade{display:none!important}
	.tc-mbar{display:none}
	.tc-footer{padding-bottom:28px}
	.tc-icons{gap:24px;padding:0 20px}
	.tc-steps{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* ===== phones: ทำให้ตาราง layout เก่าในบทความไม่ล้นจอ ===== */
@media (max-width:719px){
	.tc .tc-content table,.tc .tc-content tbody,.tc .tc-content tr,.tc .tc-content td{display:block;width:auto!important;height:auto!important}
	.tc .tc-content table.tc-keep,.tc .tc-content table.tc-keep tbody{display:table;width:100%!important}
	.tc .tc-content table.tc-keep tr{display:table-row}
	.tc .tc-content table.tc-keep td,.tc .tc-content table.tc-keep th{display:table-cell}
	.tc .tc-content td{padding:4px 0}
	.tc .tc-content img{float:none!important;margin-left:auto;margin-right:auto}
}
@media (prefers-reduced-motion:reduce){.tc-side{transition:none}}
@media print{.tc-topbar,.tc-header,.tc-side,.tc-mbar,.tc-footer,.tc-banner,.tc-banner-cap{display:none!important}.tc-content{border:0;padding:0}}

/* icon / tile tables in old content: kept as grids on phones (class added by template.js) */
@media (max-width:719px){
	.tc .tc-content table.tc-grid3 tr{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:start}
	.tc .tc-content table.tc-grid2 tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:start}
	.tc .tc-content table.tc-grid3 td,.tc .tc-content table.tc-grid2 td{display:flex!important;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;text-align:center;font-size:13px;line-height:1.35;min-width:0;padding:0!important}
	.tc .tc-content table.tc-grid3 br,.tc .tc-content table.tc-grid2 br{display:none}
	.tc .tc-content table.tc-grid3 img,.tc .tc-content table.tc-grid2 img{display:block;margin:0 auto}
	.tc .tc-content table.tc-grid2 tr+tr{margin-top:6px}
	.tc .tc-content table.tc-grid3 td p,.tc .tc-content table.tc-grid2 td p{margin:0;font-size:0;line-height:0}
	.tc .tc-content table.tc-grid3 td p a,.tc .tc-content table.tc-grid2 td p a{font-size:14px;line-height:1.4;display:inline-block}
	.tc .tc-content table.tc-grid3 img{width:100%;max-width:96px;height:auto}
	.tc .tc-content table.tc-grid2 img{width:100%;max-width:200px;height:auto}
}
