/* Talent Hunts redesign: article and job post templates.
   Loaded after th-site.css by views/site/article_detail.php and job_detail.php.
   Post content comes from the admin editor and is tidied in PHP; these rules
   give every post the same type and spacing as the service pages. */

/* ------------------------------------------------------------ article hero */
.pg-post-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 380px; border-radius: 16px; overflow: hidden;
    background: var(--th-green-900);
}
.pg-post-hero__text {
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 56px 48px max(56px, calc((100vw - 1200px) / 2 + 14px));
    background: linear-gradient(135deg, var(--th-green-900) 0%, var(--th-green-700) 100%);
}
.pg-post-hero .pg-crumbs { margin-bottom: 16px; }
.pg-page .pg-post-hero h1 {
    margin: 0 0 16px; color: #fff;
    font-size: 34px; line-height: 1.22; font-weight: 800;
}
.pg-post-hero__meta { margin: 0; font-size: 14px; line-height: 20px; color: var(--th-green-50); }
.pg-post-hero__media { position: relative; min-height: 100%; background: var(--th-green-700); }
.pg-post-hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 991px) {
    .pg-post-hero { grid-template-columns: 1fr; min-height: 0; }
    .pg-post-hero__media { order: -1; aspect-ratio: 16 / 9; min-height: 0; }
    .pg-post-hero__text { padding: 32px 24px; }
    .pg-page .pg-post-hero h1 { font-size: 28px; }
}
@media (max-width: 767px) {
    .pg-post-hero { border-radius: 12px; }
    .pg-post-hero__text { padding: 24px 16px 28px; }
    .pg-page .pg-post-hero h1 { font-size: 24px; }
}

/* ------------------------------------------------------------ post body */
.pg-article--post { max-width: 760px; }
.pg-post-body { color: var(--th-ink); }
.pg-post-body > *:first-child { margin-top: 0 !important; }
.pg-article .pg-post-body p,
.pg-post-body li {
    font-size: 14px; line-height: 24px; color: var(--th-ink);
}
.pg-article .pg-post-body p { margin: 0 0 14px; }
.pg-article .pg-post-body p { text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.pg-post-body strong, .pg-post-body b { font-weight: inherit; }
.pg-page .pg-post-body h2 {
    margin: 32px 0 12px; font-size: 24px; line-height: 32px; font-weight: 700; color: var(--th-ink);
    scroll-margin-top: calc(var(--pg-header) + 16px);
}
.pg-page .pg-post-body h3 {
    margin: 24px 0 10px; font-size: 19px; line-height: 27px; font-weight: 700; color: var(--th-ink);
    scroll-margin-top: calc(var(--pg-header) + 16px);
}
.pg-page .pg-post-body h4, .pg-page .pg-post-body h5, .pg-page .pg-post-body h6 {
    margin: 20px 0 8px; font-size: 16px; line-height: 24px; font-weight: 700; color: var(--th-ink);
}
.pg-post-body ul, .pg-post-body ol { margin: 0 0 16px; padding-left: 22px; }
.pg-post-body li { margin: 0 0 6px; }
.pg-post-body li > p { margin: 0 !important; }
.pg-post-body ul li::marker { color: var(--th-green); }
.pg-post-body ol li::marker { color: var(--th-green-700); font-weight: 700; }
.pg-post-body img { display: block; max-width: 100%; height: auto; margin: 20px 0; border-radius: 8px; }
.pg-post-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; line-height: 22px; }
.pg-post-body th, .pg-post-body td { padding: 10px 12px; border: 1px solid var(--th-line); text-align: left; vertical-align: top; }
.pg-post-body th { background: var(--th-green-50); font-weight: 700; }
.pg-post-body blockquote { margin: 20px 0; padding: 16px 20px; border-left: 3px solid var(--th-green); background: var(--th-green-50); border-radius: 0 8px 8px 0; }
.pg-post-body hr { margin: 28px 0; border: 0; border-top: 1px solid var(--th-line); }
.pg-post-body iframe, .pg-post-body video { max-width: 100%; }

.pg-post-cta { margin-top: 32px; }
.pg-post-cta p { margin: 0 !important; font-weight: 600; flex: 1 1 280px; }
.pg-article .pg-post-more { margin: 20px 0 0; font-size: 14px; color: var(--th-muted); }
.pg-post-more a { font-weight: 600; }

/* ------------------------------------------------------------ job post */
.jd-head { max-width: 1200px; margin: 0 auto; padding: 40px 24px 0; }
.jd-head .pg-crumbs ol { color: var(--th-muted); }
.jd-head .pg-crumbs li + li::before { color: var(--th-line); }
.jd-head .pg-crumbs a { color: var(--th-green-700); }
.jd-head__date { margin: 16px 0 8px; font-size: 14px; line-height: 20px; color: var(--th-muted); }
.pg-page .jd-head h1 {
    max-width: 900px; margin: 0 0 20px; color: var(--th-ink);
    font-size: 34px; line-height: 1.22; font-weight: 800;
}
.jd-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-bottom: 32px; border-bottom: 1px solid var(--th-line); }
.jd-head__cv { font-size: 15px; font-weight: 600; color: var(--th-green-700) !important; text-decoration: underline; text-underline-offset: 3px; }

.pg-job .pg-body { padding-top: 32px; }
.jd-side {
    position: sticky; top: calc(var(--pg-header) + 24px);
    display: flex; flex-direction: column; gap: 20px;
}
.jd-filter {
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px; border: 1px solid var(--th-line); border-radius: 8px; background: #fff;
}
.jd-filter__title { margin: 0 0 4px !important; font-family: "Muli", "Mulish", sans-serif; font-size: 17px; line-height: 24px; font-weight: 800; color: var(--th-ink); }
.jd-filter input[type=text], .jd-filter select {
    width: 100%; height: 44px; padding: 0 12px;
    border: 1px solid var(--th-line); border-radius: 8px; background: #fff;
    font: inherit; font-size: 14px; color: var(--th-ink);
}
.jd-filter input[type=text]:focus, .jd-filter select:focus { outline: 2px solid var(--th-green-700); outline-offset: 1px; border-color: var(--th-green-700); }
.jd-filter .th-btn { height: 44px; margin-top: 4px; font-size: 15px; }
.jd-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 991px) {
    .jd-side { position: static; order: 2; }
    .pg-page .jd-head h1 { font-size: 28px; }
}
@media (max-width: 767px) {
    .jd-head { padding: 28px 16px 0; }
    .pg-page .jd-head h1 { font-size: 24px; }
    .jd-head__actions .th-btn { width: 100%; }
}

/* ------------------------------------------------------------ FAQ page */
.faq-intro { margin-bottom: 24px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
    border: 1px solid var(--th-line); border-radius: 8px; background: #fff;
    scroll-margin-top: calc(var(--pg-header) + 16px);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.faq-item[open] { border-color: var(--th-green); box-shadow: 0 4px 18px rgba(15, 61, 36, .08); }
.faq-item__q {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 20px; cursor: pointer; list-style: none;
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::marker { content: ""; }
.pg-page .faq-item__q h2 {
    margin: 0; font-size: 18px; line-height: 26px; font-weight: 700; color: var(--th-ink);
}
.faq-item__q:hover h2 { color: var(--th-green-700); }
.faq-item__q:focus-visible { outline: 2px solid var(--th-green-700); outline-offset: 2px; border-radius: 8px; }
.faq-item__icon {
    position: relative; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
    background: var(--th-green-50); transition: background-color .2s ease, transform .25s ease;
}
.faq-item__icon::before, .faq-item__icon::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px;
    background: var(--th-green-700); border-radius: 1px; transition: transform .25s ease;
}
.faq-item__icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-item__icon { background: var(--th-green); }
.faq-item[open] .faq-item__icon::before, .faq-item[open] .faq-item__icon::after { background: #fff; }
.faq-item[open] .faq-item__icon::after { transform: rotate(0deg); }
.faq-item__a { padding: 0 20px 20px; border-top: 1px solid var(--th-line); padding-top: 16px; margin: 0 0; }
.faq-item__a > *:last-child { margin-bottom: 0 !important; }
@media (max-width: 767px) {
    .faq-item__q { padding: 16px; }
    .pg-page .faq-item__q h2 { font-size: 16px; line-height: 24px; }
    .faq-item__a { padding: 14px 16px 16px; }
}

/* ------------------------------------------------------------ mobile-friendly post content */
.pg-table-scroll { width: 100%; margin: 20px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pg-table-scroll > table { margin: 0; min-width: 480px; }
.pg-embed { position: relative; width: 100%; margin: 20px 0; aspect-ratio: 16 / 9; }
.pg-embed iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.pg-post-body img { height: auto; }
.pg-post-body { overflow-wrap: break-word; }

/* ------------------------------------------------------------ related posts / jobs */
.pg-related { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--th-line); }
.pg-page .pg-related__title { margin: 0 0 16px; font-family: "Muli", "Mulish", sans-serif; font-size: 20px; line-height: 28px; font-weight: 800; color: var(--th-ink); }
.pg-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pg-related__card { display: flex; flex-direction: column; gap: 10px; text-decoration: none !important; }
.pg-related__card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--th-green-50); }
.pg-related__name { font-size: 15px; line-height: 22px; font-weight: 700; color: var(--th-ink); }
.pg-related__card:hover .pg-related__name { color: var(--th-green-700); }
.pg-related__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--th-line); }
.pg-related__list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--th-line); font-size: 15px; line-height: 22px; }
.pg-related__list a { font-weight: 600; color: var(--th-ink) !important; text-decoration: none; }
.pg-related__list a:hover { color: var(--th-green-700) !important; }
.pg-related__list span { flex: none; font-size: 13px; color: var(--th-muted); }
@media (max-width: 767px) {
    .pg-related__grid { grid-template-columns: 1fr; }
    .pg-related__list li { flex-direction: column; gap: 2px; }
}
