/* Legacy Vanilla CSS removed in favor of Tailwind CSS in v2.6.0+ */

/* Animation utilities for the tabs */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Categories Filter Navigation Bar Responsive Wrap Override */
.mb-8.border-b.border-gray-100.pb-4.flex.no-scrollbar {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 0.625rem !important; /* 10px spacing */
}

/* Fix bilingual logo text clipping / cut-off */
.glass-header a.group {
    overflow: visible !important;
}
.glass-header a.group > div {
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-left: 12px !important;
    padding-right: 8px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
.header-logo-kh-title {
    font-size: 9px !important;
    line-height: 2.5 !important;
    padding-top: 12px !important;
    padding-bottom: 6px !important;
    display: block !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
}
.header-logo-en-title {
    font-size: 7px !important;
    line-height: 1.5 !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    display: block !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
}

@media (min-width: 640px) {
    .header-logo-kh-title {
        font-size: 11.5px !important;
    }
    .header-logo-en-title {
        font-size: 8.5px !important;
    }
}

@media (min-width: 768px) {
    .header-logo-kh-title {
        font-size: 12.5px !important;
    }
    .header-logo-en-title {
        font-size: 9.5px !important;
    }
}

/* Ensure cards hide vertical overflow cleanly and maintain solid structure */
[class*="-card"],
.dir-dept-block,
.dir-fac-block,
.group.bg-white\/90 {
    overflow: hidden !important;
}

/* Fix Khmer Font clipping inside Directory Collapsible Section Banners and Divider Headers */
.dir-fac-header,
.dir-dept-header {
    overflow: visible !important;
}
.dir-fac-header h3,
.dir-dept-header h3,
.dir-dept-faculty-group h3 {
    line-height: 2.15 !important;
    padding-top: 12px !important;
    padding-bottom: 6px !important;
    overflow: visible !important;
}

/* Fix Khmer font clipping inside Lecturer Cards (Names and Position Badges) */
.group h3.font-inter,
.group h3 {
    line-height: 1.3 !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
}

.group span.truncate,
.group .truncate {
    line-height: 1.25 !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
}

/* Global Khmer Font Layout Protection for all cards on all pages */
[class*="-card"] h1, [class*="-card"] h2, [class*="-card"] h3, [class*="-card"] h4, [class*="-card"] h5, [class*="-card"] h6,
[class*="-card"] p, [class*="-card"] span, [class*="-card"] a, [class*="-card"] .text-\[18px\], [class*="-card"] .font-inter,
.group h1, .group h2, .group h3, .group h4, .group h5, .group h6,
.group p, .group span, .group a, .group .text-\[18px\], .group .font-inter,
article h1, article h2, article h3, article h4, article h5, article h6,
article p, article span, article a, article .text-\[18px\], article .font-inter,
.dir-dept-block h1, .dir-dept-block h2, .dir-dept-block h3, .dir-dept-block h4, .dir-dept-block h5, .dir-dept-block h6,
.dir-dept-block p, .dir-dept-block span, .dir-dept-block a, .dir-dept-block .text-\[18px\], .dir-dept-block .font-inter,
.dir-fac-block h1, .dir-fac-block h2, .dir-fac-block h3, .dir-fac-block h4, .dir-fac-block h5, .dir-fac-block h6,
.dir-fac-block p, .dir-fac-block span, .dir-fac-block a, .dir-fac-block .text-\[18px\], .dir-fac-block .font-inter {
    line-height: 1.3 !important;
    padding-top: 1px !important;
}

/* Align all card buttons/links horizontally centered and push to bottom */
[class*="-card"] .border-t,
article .border-t,
.pub-grid-card .border-t,
.news-card .border-t {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-top: 1px solid rgba(243, 244, 246, 0.8) !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    margin-top: auto !important;
}

/* Ensure all action buttons inside cards have a solid colored background and are rounded */
[class*="-card"] .border-t a,
article .border-t a,
.pub-grid-card .border-t a,
.news-card .border-t a,
.group a.mt-auto {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background-color: #003087 !important; /* Solid Brand Blue */
    color: #ffffff !important; /* Solid White Text */
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 10px !important;
    letter-spacing: 0.05em !important;
    padding: 8px 18px !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease !important;
    width: auto !important;
    min-width: 140px !important;
    margin: 2px 0 !important;
}

[class*="-card"] .border-t a:hover,
article .border-t a:hover,
.pub-grid-card .border-t a:hover,
.news-card .border-t a:hover,
.group a.mt-auto:hover {
    background-color: #00205b !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Automated Khmer Font Detection & Responsive Card Typography System */
.has-khmer-text,
.card-has-khmer,
.card-has-khmer h1, .card-has-khmer h2, .card-has-khmer h3,
.card-has-khmer h4, .card-has-khmer h5, .card-has-khmer h6,
.card-has-khmer p, .card-has-khmer span, .card-has-khmer a, .card-has-khmer div {
    font-family: 'Siemreap', 'Kantumruy Pro', sans-serif !important;
}

/* Card Headings / Titles containing Khmer text */
.has-khmer-text:is(h1, h2, h3, h4, h5, h6),
.card-has-khmer :is(h1, h2, h3, h4, h5, h6),
.card-has-khmer .font-bold:is(h1, h2, h3, h4, h5, h6, a, div) {
    font-size: 0.9375rem !important; /* ~15px on mobile */
    line-height: 1.6 !important;
    padding-top: 1px !important;
}

@media (min-width: 768px) {
    .has-khmer-text:is(h1, h2, h3, h4, h5, h6),
    .card-has-khmer :is(h1, h2, h3, h4, h5, h6),
    .card-has-khmer .font-bold:is(h1, h2, h3, h4, h5, h6, a, div) {
        font-size: 1.0625rem !important; /* ~17px on desktop */
        line-height: 1.65 !important;
    }
}

/* Card Excerpts & Descriptions containing Khmer text */
.has-khmer-text:is(p, span, div),
.card-has-khmer :is(p, span) {
    font-size: 0.8125rem !important; /* ~13px on mobile */
    line-height: 1.55 !important;
}

@media (min-width: 768px) {
    .has-khmer-text:is(p, span, div),
    .card-has-khmer :is(p, span) {
        font-size: 0.875rem !important; /* ~14px on desktop */
        line-height: 1.6 !important;
    }
}

/* Subtitles, Badges & Meta Tags with Khmer Text */
.has-khmer-text:is(.text-xs, .text-\[11px\], .text-\[10px\], .text-\[9px\]),
.card-has-khmer :is(.text-xs, .text-\[11px\], .text-\[10px\], .text-\[9px\]) {
    font-size: 0.75rem !important; /* ~12px on mobile */
    line-height: 1.5 !important;
}

@media (min-width: 768px) {
    .has-khmer-text:is(.text-xs, .text-\[11px\], .text-\[10px\], .text-\[9px\]),
    .card-has-khmer :is(.text-xs, .text-\[11px\], .text-\[10px\], .text-\[9px\]) {
        font-size: 0.8125rem !important; /* ~13px on desktop */
        line-height: 1.55 !important;
    }
}

