/*
Theme Name: Elead Avide
Theme URI: https://themepalace.com/downloads/elead/
Template: elead
Author: AVIDE
Author URI: https://avide.dk
Description: Theme for AVIDE. Created by Vang Le 2024 03 15
Tags: avide,elead
Version: 1.2.6.20260423d
Updated: 2026-04-23 00:00:00

*/

/* ── Sticky featured post: side-by-side card (text left, image right) ───── */

/*
 * Strategy: match the parent's exact selectors so that child stylesheet
 * source-order wins. Only use !important where the parent uses it.
 *
 * Parent rules we must beat (themes/elead/style.css):
 *   .hentry.sticky .entry-container          { padding: 80px 50px !important; }
 *   .sticky .entry-container .entry-header   { width: 35%; float: left; … }
 *   .blog .sticky .entry-title               { font-size: 46px; … }
 */

/* Card: flex row, tight spacing between cards */
.hentry.sticky {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

/*
 * Text column — uses same selector as parent (.hentry.sticky .entry-container)
 * so child stylesheet wins by source order. !important needed because parent
 * declares padding: 80px 50px !important on this exact selector.
 */
.hentry.sticky .entry-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px 24px !important;
    background-color: #f9f5f1;
}

/* Reset parent's float-based 35/65 sub-columns inside text column */
.sticky .entry-container .entry-header {
    order: 1;
    width: 100%;
    float: none;
    clear: both;
    padding-right: 0;
    margin-top: 0;
}

.hentry.sticky .entry-content {
    order: 2;
    float: none;
    width: 100%;
    max-height: none;
    min-height: 0;
    overflow: visible;
    margin: 0;
}

.hentry.sticky .entry-content p {
    -webkit-column-count: 1;
    -moz-column-count: 1;
    column-count: 1;
    margin-bottom: 0;
}

.hentry.sticky .entry-footer {
    order: 3;
    clear: both;
    margin-top: 16px;
}

/* Image column */
.hentry.sticky figure.featured-image {
    flex: 0 0 42%;
    position: relative;
    overflow: hidden;
    min-height: 220px;
}

.hentry.sticky figure.featured-image > div {
    height: 100%;
    min-height: 220px;
    background-size: cover;
    background-position: center;
}

.hentry.sticky figure.featured-image p.entry-meta {
    position: absolute;
    top: 8px;
    right: 15px;
    bottom: auto;
    left: auto;
}

/*
 * Title — uses .blog .sticky to match parent's selector (.blog .sticky .entry-title)
 * then adds .hentry for higher specificity, so no !important needed.
 */
.blog .hentry.sticky .entry-title {
    font-size: 20px;
    line-height: 1.3;
    margin: 4px 0 8px;
    font-weight: 700;
    color: #4a342f;
    text-transform: none;
    letter-spacing: 0;
}

.hentry.sticky .entry-title a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    color: inherit;
}

/* Mobile: stack vertically */
@media (max-width: 767px) {
    .hentry.sticky {
        flex-direction: column;
    }
    .hentry.sticky figure.featured-image {
        flex: 0 0 auto;
        min-height: 200px;
        order: -1;
    }
    .blog .hentry.sticky .entry-title {
        font-size: 18px;
        margin-bottom: 6px;
    }
}

/* ── Legal pages: reduce oversized theme-rendered page title ────────────── */
/*
 * Parent renders h1.page-title at 72px (h1 rule) / 62px (.entry-title rule).
 * Target by page ID so only these two pages are affected.
 */
.page-id-1481 .page-header,
.page-id-1482 .page-header {
    padding-bottom: 12px;
}
.page-id-1481 h1.page-title,
.page-id-1482 h1.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ── Read-more link: show post title on second line ─────────────────────── */
.entry-footer .entry-meta a .read-more-title {
    display: block;
    font-size: 0.8em;
    font-weight: 400;
    color: inherit;
    opacity: 0.75;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    margin-top: 2px;
}

.hentry.sticky .entry-content .avide-sticky-readmore {
    margin-top: 12px;
}

/* ── Partner archive (Đối Tác, category: doi-tac) ───────────────────────── */
.partner-archive {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

.partner-archive__header {
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0cfc8;
    padding-bottom: 1.25rem;
}

.partner-archive__title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: #2e2624;
}

.partner-archive__desc {
    color: #666;
    font-size: 1rem;
    margin: 0 0 1rem;
}

/* Subcategory filter bar */
.partner-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.partner-filter__btn {
    display: inline-block;
    padding: 0.3em 0.9em;
    border: 1px solid var(--partner-accent-bg, #c1331b);
    border-radius: 2em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--partner-accent-bg, #c1331b);
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.partner-filter__btn:hover,
.partner-filter__btn.is-active {
    background: var(--partner-accent-bg, #c1331b);
    border-color: var(--partner-accent-bg, #c1331b);
    color: var(--partner-accent-fg, #fff);
}

/* Subcategory section */
.partner-section {
    margin-bottom: 2.5rem;
}

.partner-section__heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0cfc8;
    font-size: 1rem;
}

.partner-section__heading .partner-badge {
    font-size: 0.85rem;
    padding: 0.3em 0.9em;
}

/* Card grid */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ── Footer: robust wrapping for long legal titles + palette refresh ────── */
.site-info.avide-footer-legal {
    background: linear-gradient(90deg, #241a1a 0%, #2c1c1a 55%, #31201b 100%);
    color: #f3e9df;
}

.site-info.avide-footer-legal .wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem 1.2rem;
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.site-info.avide-footer-legal .copyright,
.site-info.avide-footer-legal .legal-links {
    float: none;
    margin: 0;
    line-height: 1.45;
}

.site-info.avide-footer-legal .copyright {
    flex: 1 1 440px;
    font-size: 0.98rem;
    color: #f3e9df;
}

.site-info.avide-footer-legal .legal-links {
    flex: 1 1 320px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.site-info.avide-footer-legal .legal-links a {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(242, 107, 51, 0.48);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.07);
    color: #ffd7c4;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-info.avide-footer-legal .legal-links a:hover,
.site-info.avide-footer-legal .legal-links a:focus {
    color: #fff4e7;
    border-color: rgba(255, 173, 130, 0.9);
    background: rgba(242, 107, 51, 0.35);
}

.site-info.avide-footer-legal a {
    color: #ff6b3a;
}

.site-info.avide-footer-legal a:hover,
.site-info.avide-footer-legal a:focus {
    color: #ffb08f;
}

/* Hide the old inline separator dots between legal links. */
.site-info.avide-footer-legal .legal-links {
    font-size: 0;
}

.site-info.avide-footer-legal .legal-links a {
    font-size: 0.95rem;
}

/* Mid-width desktops: split footer into two centered rows for better balance
 * when legal labels are long (e.g. Vietnamese).
 */
@media (min-width: 992px) and (max-width: 1320px) {
    .site-info.avide-footer-legal .wrapper {
        justify-content: center;
        align-items: flex-start;
        gap: 0.6rem 1rem;
    }

    .site-info.avide-footer-legal .copyright,
    .site-info.avide-footer-legal .legal-links {
        flex: 1 1 100%;
        text-align: center;
        justify-content: center;
    }

    .site-info.avide-footer-legal .legal-links a {
        font-size: 0.92rem;
        padding: 0.28rem 0.56rem;
    }
}

@media (max-width: 991px) {
    .site-info.avide-footer-legal .wrapper {
        justify-content: center;
    }

    .site-info.avide-footer-legal .copyright,
    .site-info.avide-footer-legal .legal-links {
        flex: 1 1 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .site-info.avide-footer-legal .wrapper {
        padding-top: 0.8rem;
        padding-bottom: 0.85rem;
    }

    .site-info.avide-footer-legal .copyright {
        font-size: 0.9rem;
    }

    .site-info.avide-footer-legal .legal-links a {
        padding: 0.26rem 0.52rem;
        font-size: 0.88rem;
    }
}

@media (max-width: 900px) {
    .partner-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .partner-grid { grid-template-columns: 1fr; }
}

.partner-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.18s, border-color 0.18s;
}

.partner-card:hover {
    box-shadow: 0 4px 20px rgba(193,51,27,0.13);
    border-color: #f0cfc8;
}

.partner-card__img-link {
    display: block;
    background: #f5f0ee;
}

.partner-card__img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.partner-card__img--placeholder {
    height: 190px;
    background: #ede8e4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Crect width='80' height='80' fill='none'/%3E%3Cpath d='M20 52 l10-14 8 10 6-8 16 22H20z' fill='%23c9b8b0'/%3E%3Ccircle cx='56' cy='26' r='6' fill='%23c9b8b0'/%3E%3C/svg%3E") center/40px no-repeat;
}

.partner-card__body {
    padding: 1rem 1.1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.partner-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.partner-card__title a {
    color: #2e2624;
    text-decoration: none;
}

.partner-card__title a:hover {
    color: #c1331b;
    text-decoration: underline;
}

.partner-card__excerpt {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Category badges — colours from AVIDE logo: red #c1331b, navy #2d3561, amber #f5a623 */
.partner-badge {
    display: inline-block;
    padding: 0.18em 0.65em;
    border-radius: 1em;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
    background: var(--partner-accent-bg, #c1331b);
    color: var(--partner-accent-fg, #fff);
}

.partner-archive__empty {
    color: #888;
    font-style: italic;
    padding: 2rem 0;
}

/* Dedicated language menu strip (top-right, above main menu) */
.avide-language-strip {
    background: #f7f7f7;
    border-top: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
}

.avide-language-strip .wrapper {
    display: flex;
    justify-content: flex-end;
}

#avide-language-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}

#avide-language-menu > li {
    margin: 0;
}

#avide-language-menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    color: #4a4a4a;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    padding: 0.25rem 0.45rem;
    border-radius: 4px;
}

#avide-language-menu > li > a:hover {
    background: #efefef;
    color: #222;
}

#avide-language-menu > li.current-lang > a {
    background: #e9e9e9;
    color: #1f1f1f;
}

@media (max-width: 767px) {
    .avide-language-strip .wrapper {
        justify-content: center;
    }

    #avide-language-menu {
        gap: 0.4rem;
        padding: 0.3rem 0;
    }

    #avide-language-menu > li > a {
        font-size: 0.8rem;
        padding: 0.2rem 0.35rem;
    }
}


/* ── Masthead language switcher (top-right) ───────────────────────────── */
/* Strengthen specificity so child-theme wins over any parent-theme rule. */
.site-header#masthead {
    position: relative;
}

#avide-lang-bar {
    position: absolute;
    top: 14px;
    right: 24px;
    z-index: 8;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #ece7e2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#avide-lang-bar .avide-lang-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    text-decoration: none;
    color: #4a3f37;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: background-color .2s ease, color .2s ease;
}

#avide-lang-bar .avide-lang-link:hover {
    background: #f7f1eb;
    color: #972111;
}

#avide-lang-bar .avide-lang-link.is-current {
    background: #c5301a;
    color: #fff;
}

#avide-lang-bar .avide-lang-flag {
    display: inline-block;
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

#avide-lang-bar .avide-lang-code {
    font-size: 11px;
    letter-spacing: .04em;
}

@media (max-width: 991px) {
    #avide-lang-bar {
        top: 10px;
        right: 12px;
        padding: 3px 6px;
        gap: 6px;
    }

    #avide-lang-bar .avide-lang-name {
        display: none;
    }
}
