/* ============================================================
   PanmaneeCNC — learn.thairobot.net custom overrides
   (Cassiopeia / Joomla 5 — โหลดอัตโนมัติจาก template)
   ============================================================ */

/* ------------------------------------------------------------
   1) ปุ่ม "อ่านต่อ" (read more) — พื้นน้ำเงิน ตัวขาว
   (ยังใช้ในกรณีที่ตั้งค่าแสดง intro + readmore)
   ------------------------------------------------------------ */
p.readmore a.btn,
p.readmore a.btn-secondary,
.blog-item .readmore a,
.com-content-category-blog__item .readmore a {
    background-color: #0d3b8c !important;
    border: 1px solid #0d3b8c !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    text-decoration: none !important;
    display: inline-block;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
    box-shadow: 0 2px 6px rgba(13, 59, 140, .28);
}

p.readmore a.btn:hover,
p.readmore a.btn-secondary:hover,
.blog-item .readmore a:hover,
.com-content-category-blog__item .readmore a:hover {
    background-color: #082a66 !important;
    border-color: #082a66 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(13, 59, 140, .45);
    transform: translateY(-1px);
}

p.readmore a.btn:focus-visible,
p.readmore a.btn-secondary:focus-visible {
    outline: 3px solid rgba(13, 59, 140, .45);
    outline-offset: 2px;
}

p.readmore a.btn .icon-chevron-right,
p.readmore a.btn-secondary .icon-chevron-right {
    color: #ffffff !important;
    margin-right: .35rem;
}

/* ------------------------------------------------------------
   2) หน้าหมวดแบบ "list หัวข้อล้วน"
   Joomla 5 สร้าง: div.items-more > ol.com-content-blog__links > li.com-content-blog__link
   ทำเป็นรายการ卡片อ่านง่าย: เส้นคั่น, hover ไฮไลต์, เลขลำดับสีน้ำเงิน
   ------------------------------------------------------------ */

.items-more {
    margin-top: .25rem;
}

ol.com-content-blog__links {
    list-style: none;
    counter-reset: bloglink;
    padding-left: 0;
    margin-bottom: 0;
}

ol.com-content-blog__links > li.com-content-blog__link {
    counter-increment: bloglink;
    position: relative;
    padding: .7rem .9rem .7rem 3rem;
    margin-bottom: .35rem;
    border: 1px solid #e3e8f0;
    border-left: 4px solid #0d3b8c;
    border-radius: 6px;
    background: #fbfcfe;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

/* เลขลำดับ */
ol.com-content-blog__links > li.com-content-blog__link::before {
    content: counter(bloglink);
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    line-height: 1.75rem;
    text-align: center;
    background: #0d3b8c;
    color: #fff;
    border-radius: 50%;
    font-size: .82rem;
    font-weight: 700;
}

/* hover — ยกการ์ดขึ้นเล็กน้อย */
ol.com-content-blog__links > li.com-content-blog__link:hover {
    background: #eef3fc;
    box-shadow: 0 3px 10px rgba(13, 59, 140, .14);
    transform: translateX(2px);
}

/* ตัวลิงก์หัวเรื่อง */
ol.com-content-blog__links > li.com-content-blog__link a {
    color: #12327a;
    font-weight: 600;
    font-size: 1.02rem;
    text-decoration: none;
    display: block;
}

ol.com-content-blog__links > li.com-content-blog__link a:hover {
    color: #0d3b8c;
    text-decoration: underline;
}

/* จอเล็ก — ลดระยะ padding */
@media (max-width: 575.98px) {
    ol.com-content-blog__links > li.com-content-blog__link {
        padding: .6rem .7rem .6rem 2.6rem;
        font-size: .97rem;
    }
}


/* ============================================================
   3) หน้าค้นหา (com_finder / Smart Search) — จัดรูปแบบให้อ่านง่าย
   ============================================================ */
.com-finder {
    font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a2e;
    line-height: 1.7;
}

/* ช่องค้นหา */
.com-finder .js-finder-searchform {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
}
.com-finder .js-finder-search-query.form-control {
    flex: 1 1 260px;
    min-width: 0;
    border: 1px solid #d7dfec;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 15.5px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.com-finder .js-finder-search-query.form-control:focus {
    border-color: #0077ff;
    box-shadow: 0 0 0 3px rgba(0, 119, 255, .15);
}
.com-finder .btn.btn-primary {
    border-radius: 50px;
    padding: 12px 26px;
    font-weight: 600;
    background: linear-gradient(135deg, #0077ff, #0055cc);
    border: 0;
}
.com-finder .btn.btn-secondary {
    border-radius: 50px;
    padding: 12px 20px;
    font-weight: 500;
}

/* จำนวนผลลัพธ์ */
.com-finder .com-finder__tips {
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #f8fafc;
    padding: 14px 18px;
    font-size: .95rem;
    color: #475569;
}

/* การ์ดผลลัพธ์ */
.com-finder .result__item {
    list-style: none;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-left: 4px solid #0077ff;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 12px;
    transition: box-shadow .2s, transform .2s;
}
.com-finder .result__item:hover {
    box-shadow: 0 10px 28px rgba(0, 119, 255, .10);
    transform: translateX(2px);
}
.com-finder ol.search-results,
.com-finder .search-results {
    padding-left: 0;
    margin: 0;
}

/* URL ของผลลัพธ์ — ทำเป็นบรรทัดเล็กสีเทา */
.com-finder .result__url {
    display: block;
    font-size: .78rem;
    color: #94a3b8;
    word-break: break-all;
    margin-bottom: 5px;
    text-decoration: none;
}
.com-finder .result__title {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0 0 7px;
    line-height: 1.5;
}
.com-finder .result__title a { color: #0d3b8c; text-decoration: none; }
.com-finder .result__title a:hover { color: #0077ff; text-decoration: underline; }

.com-finder .result__snippet {
    font-size: .94rem;
    color: #475569;
    margin-bottom: 9px;
    line-height: 1.75;
}

/* ป้าย Type / Category */
.com-finder .result__taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 0;
    font-size: .8rem;
}
.com-finder .result__taxonomy-item {
    list-style: none;
    background: rgba(0, 119, 255, .08);
    color: #0d3b8c;
    border-radius: 50px;
    padding: 3px 12px;
    font-weight: 600;
}

/* คำที่ตรงกับคำค้น — ไฮไลต์เหลืองอ่อน */
.com-finder .highlight,
.com-finder mark {
    background: #fef3c7;
    color: inherit;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* แถบเรียงลำดับ/ตัวกรอง */
.com-finder .form-select,
.com-finder select { border-radius: 10px; }
.com-finder legend { font-size: 1.05rem; font-weight: 700; }
.com-finder fieldset { border: 0; padding: 0; }

@media (max-width: 767.98px) {
    .com-finder .result__item { padding: 14px 16px; }
    .com-finder .result__title { font-size: 1rem; }
}


/* ============================================================
   4) ช่องค้นหาใน header (mod_finder) — ใช้ทุกหน้า
   ============================================================ */
.container-search {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
}

.container-search .mod-finder,
.container-search form { margin: 0; width: 100%; max-width: 380px; }

/* กล่องค้นหา */
.container-search .js-finder-search-query.form-control {
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50px 0 0 50px;
    background: rgba(255, 255, 255, .97);
    padding: 0 20px;
    font-size: 14px;
    color: #1a1a2e;
    box-shadow: none;
    transition: box-shadow .2s, border-color .2s;
}

.container-search .js-finder-search-query.form-control::placeholder {
    color: #8b98ad;
    font-size: 13.5px;
}

.container-search .js-finder-search-query.form-control:focus {
    border-color: #4da3ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 119, 255, .28);
}

/* ปุ่มค้นหา */
.container-search .btn.btn-primary,
.container-search button[type="submit"] {
    height: 44px;
    border-radius: 0 50px 50px 0;
    padding: 0 22px;
    border: 0;
    background: #0077ff;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background .2s;
}

.container-search .btn.btn-primary:hover,
.container-search button[type="submit"]:hover { background: #0062d6; }

/* ปุ่ม "ค้นหาแบบละเอียด" (ถ้าเปิด) */
.container-search .btn.btn-secondary {
    height: 36px;
    margin-top: 6px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: transparent;
    color: #cfe4ff;
    font-size: 12.5px;
    padding: 0 16px;
}

/* Autosuggest dropdown ให้ตรงกับช่อง */
.container-search .awesomplete > ul {
    border-radius: 12px;
    margin-top: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
}

@media (max-width: 991.98px) {
    .container-search { justify-content: stretch; }
    .container-search form { max-width: 100%; }
}


/* header: ไม่มีเมนูในแถวนี้ (เมนูอยู่ sidebar) — ลดความสูงส่วนเกิน */
.header { padding-top: 8px; padding-bottom: 14px; }
.header .container-nav:has(.container-search) { align-items: center; }
@media (min-width: 992px) {
    .header .container-nav { padding-top: 0; padding-bottom: 0; }
}




/* header: ลดช่องว่างแนวตั้ง (ไม่มีเมนูในแถวนี้ เมนูอยู่ sidebar) */
.header { padding-top: 4px !important; padding-bottom: 8px !important; }
.header > .grid-child { padding-top: 4px !important; padding-bottom: 4px !important; }
.header .navbar-brand { margin: 0 !important; }
.header .container-nav { padding-top: 0 !important; padding-bottom: 0 !important; }
