/*
Theme Name: Ipearts
Theme URI:  https://www.ipearts.com
Author:     คณะศิลปศาสตร์
Author URI: https://www.ipearts.com
Template:   hello-elementor
Version:    1.0
License:    GNU General Public License v2 or later
*/

/* ── Page layout (ยกเว้น front page และ Elementor-built pages) ── */
body.page:not(.home):not(.page-template-elementor_header_footer) .site-main {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 52px 40px 72px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    body.page:not(.home):not(.page-template-elementor_header_footer) .site-main {
        padding: 36px 20px 56px !important;
    }
}

/* ── Breadcrumb ── */
.ipe-breadcrumb {
    font-size: 13px;
    color: #999;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}
.ipe-breadcrumb .ipe-bc-link {
    color: #888;
    text-decoration: none;
    transition: color 0.15s;
}
.ipe-breadcrumb .ipe-bc-link:hover {
    color: #0139a8;
    text-decoration: underline;
}
.ipe-breadcrumb .ipe-bc-sep {
    color: #bbb;
    font-size: 14px;
    line-height: 1;
}
.ipe-breadcrumb .ipe-bc-current {
    color: #555;
    font-weight: 500;
    /* truncate long titles */
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* Breadcrumb inside page content (not gray header) */
.page .ipe-breadcrumb {
    margin-bottom: 20px;
}

/* Breadcrumb บนพื้นน้ำเงิน (ipe-section) */
.ipe-section .ipe-breadcrumb {
    margin-bottom: 20px;
}
.ipe-section .ipe-breadcrumb,
.ipe-section .ipe-breadcrumb .ipe-bc-sep {
    color: rgba(255,255,255,0.5);
}
.ipe-section .ipe-breadcrumb .ipe-bc-link {
    color: rgba(255,255,255,0.65);
}
.ipe-section .ipe-breadcrumb .ipe-bc-link:hover {
    color: #fff;
    text-decoration: underline;
}
.ipe-section .ipe-breadcrumb .ipe-bc-current {
    color: rgba(255,255,255,0.9);
}

@media (max-width: 768px) {
    .ipe-breadcrumb .ipe-bc-current { max-width: 160px; }
}

/* ── Related Posts ── */
.rp-section {
    background: #f5f7fc;
    padding: 52px 0 64px;
    border-top: 4px solid #f5c400;
}
.rp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}
.rp-heading {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: #0139a8;
    margin: 0 0 28px;
}
.rp-heading a {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid #f5c400;
    padding-bottom: 2px;
}
.rp-heading a:hover { color: #d4a900; }

.rp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 900px) { .rp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .rp-grid { grid-template-columns: 1fr; } }

.rp-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.rp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.rp-card-img-link { display: block; }
.rp-card-img {
    width: 100%;
    padding-bottom: 56.25%;
    position: relative;
    overflow: hidden;
    background: #e0e4f0;
}
.rp-card-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}
.rp-card:hover .rp-card-img img { transform: scale(1.05); }
.rp-no-thumb {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #dde2f0, #eef0f8);
}
.rp-card-body {
    padding: 16px 18px 20px;
    flex: 1;
}
.rp-date {
    font-size: 11px;
    color: #aaa;
    margin: 0 0 7px;
}
.rp-title {
    font-size: 14px;
    font-weight: 700;
    color: #0139a8;
    margin: 0;
    line-height: 1.55;
}
.rp-title a { color: inherit; text-decoration: none; }
.rp-title a:hover { color: #d4a900; }

@media (max-width: 768px) {
    .rp-container { padding: 0 20px; }
    .rp-section { padding: 40px 0 48px; }
}


