/*
Theme Name: PTEC College Theme
Theme URI: https://ptec.edu.kh/
Author: Pon Samnang
Author URI: mailto:pon.samnang@ptec.edu.kh
Description: A premium, highly responsive custom WordPress theme designed for Phnom Penh Teacher Education College. Developed by Pon Samnang (tel: 096 349 0998, email: pon.samnang@ptec.edu.kh). Deeply integrates Curriculum Management, Department Content, and Lecturer Profile plugins using Tailwind CSS and custom glassmorphic styling.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ptec-theme
*/

/* Core WP Admin styles / overrides if any */
.aligncenter {
    display: block;
    margin: 0 auto;
}

.alignleft {
    float: left;
    margin: 0 20px 20px 0;
}

.alignright {
    float: right;
    margin: 0 0 20px 20px;
}

.wp-caption {
    background: #fff;
    border: 1px solid #f0f0f0;
    max-width: 100%;
    padding: 5px 3px 10px;
    text-align: center;
}

.wp-caption img {
    display: block;
    height: auto;
    max-width: 100%;
}

.wp-caption-text {
    font-size: 11px;
    line-height: 17px;
    margin: 0;
    padding: 0 5px;
}

/* Global Typography Scaling */
html {
    font-size: 17.5px !important;
    /* Scale up all font sizes and rem-based paddings/spacings by ~10% */
}

h1,
h2,
h3,
.font-h1 {
    font-family: 'Instrument Serif', 'Siemreap', serif;
}

body,
.font-subtitle,
.font-body {
    font-family: 'Inter', 'Siemreap', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #ffffff !important;
}

/* Homepage featured sections */
.ptec-feature-section {
    position: relative;
    overflow: hidden;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 1.5rem;
    transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.ptec-feature-section>* {
    position: relative;
    z-index: 1;
}

.ptec-feature-section:hover {
    transform: translateY(-2px);
}

.ptec-faculties-section {
    background: linear-gradient(135deg, #f0fdfa 0%, #eff6ff 52%, #ffffff 100%);
    box-shadow: 0 24px 60px rgba(13, 148, 136, 0.14), 0 8px 24px rgba(0, 48, 135, 0.08);
}

.ptec-faculties-section:hover {
    box-shadow: 0 30px 72px rgba(13, 148, 136, 0.2), 0 10px 30px rgba(0, 48, 135, 0.12);
}

.ptec-about-section {
    background-color: #fff2cc;
    background-image:
        linear-gradient(120deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 248, 220, 0.46) 42%, rgba(255, 235, 165, 0.72) 100%),
        linear-gradient(90deg, rgba(234, 179, 8, 0.24) 0%, rgba(255, 255, 255, 0) 64%);
    border-color: rgba(234, 179, 8, 0.34) !important;
    box-shadow: 0 30px 70px rgba(234, 179, 8, 0.28), 0 12px 30px rgba(120, 53, 15, 0.12);
}

.ptec-about-section:hover {
    box-shadow: 0 36px 82px rgba(234, 179, 8, 0.36), 0 14px 36px rgba(120, 53, 15, 0.16);
}

.ptec-partners-section {
    background-color: #dff3ff;
    background-image:
        linear-gradient(120deg, rgba(255, 255, 255, 0.76) 0%, rgba(224, 242, 254, 0.52) 45%, rgba(186, 230, 253, 0.78) 100%),
        linear-gradient(90deg, rgba(0, 48, 135, 0.18) 0%, rgba(255, 255, 255, 0) 68%);
    border-color: rgba(14, 165, 233, 0.34) !important;
    box-shadow: 0 30px 70px rgba(14, 165, 233, 0.28), 0 12px 30px rgba(0, 48, 135, 0.12);
}

.ptec-partners-section:hover {
    box-shadow: 0 36px 82px rgba(14, 165, 233, 0.36), 0 14px 36px rgba(0, 48, 135, 0.16);
}

.ptec-curriculum-section {
    background: linear-gradient(135deg, #eef2ff 0%, #fefce8 48%, #ffffff 100%);
    box-shadow: 0 24px 60px rgba(79, 70, 229, 0.16), 0 8px 24px rgba(234, 179, 8, 0.1);
}

.ptec-curriculum-section:hover {
    box-shadow: 0 30px 72px rgba(79, 70, 229, 0.22), 0 10px 30px rgba(234, 179, 8, 0.14);
}

.ptec-feature-section .faculty-card,
.ptec-feature-section .partner-card,
.ptec-feature-section .faculty-dept-group>a,
.ptec-curriculum-section .grid>div.bg-white {
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

@media (max-width: 767px) {
    .ptec-feature-section {
        margin-top: 1rem;
        margin-bottom: 1rem;
        border-radius: 1.125rem;
    }
}

.font-excerpt {
    font-family: 'Instrument Serif', 'Siemreap', serif;
    font-style: italic;
}

.font-info {
    font-family: 'Space Grotesk', 'Siemreap', sans-serif;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Creative & Humanist Font Theme Override for Single Pages */
.single,
.single .single-cpt-post,
.single body,
.single .prose,
.single .prose p,
.single p,
.single span,
.single .font-body {
    font-family: 'DM Sans', 'Siemreap', sans-serif !important;
}

.single main h1,
.single main h2,
.single main h3,
.single main h4,
.single main h5,
.single main h6,
.single article h1,
.single article h2,
.single article h3,
.single article h4,
.single article h5,
.single article h6,
.single .font-h1,
.single .single-cpt-post-headline,
.single .single-cpt-post h1,
.single .single-cpt-post h2,
.single .single-cpt-post h3,
.single .single-cpt-post h4,
.single .single-cpt-post h5,
.single .single-cpt-post h6 {
    font-family: 'Bricolage Grotesque', 'Siemreap', sans-serif !important;
}

.single .font-subtitle,
.single .single-cpt-badge {
    font-family: 'Manrope', 'Siemreap', sans-serif !important;
    font-weight: 600 !important;
    /* SemiBold */
}

.single .font-excerpt,
.single blockquote,
.single .prose blockquote,
.single .prose blockquote p,
.single italic,
.single em {
    font-family: 'Newsreader', 'Siemreap', serif !important;
}

.single .font-info,
.single .single-cpt-label,
.single .author-info,
.single .text-gray-500,
.single .text-gray-400,
.single-cpt-post .text-xs,
.single-cpt-post .text-sm.text-gray-500,
.single-cpt-post a.inline-flex,
.single-cpt-post button,
.single-cpt-post .inline-flex,
.single .meta-item,
.single .author-list,
.single .post-meta {
    font-family: 'Space Mono', 'Siemreap', monospace !important;
}

/* Explicit Right Panel Style Overrides */
.single .lg\:col-span-4 h3,
.single .cmdp-department-post-single h3 {
    font-family: 'Bricolage Grotesque', 'Siemreap', sans-serif !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

.single .lg\:col-span-4 .single-cpt-label,
.single .lg\:col-span-4 .text-gray-500,
.single .lg\:col-span-4 .text-\[11px\] {
    font-family: 'Space Mono', 'Siemreap', monospace !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.single .lg\:col-span-4 div,
.single .lg\:col-span-4 span,
.single .lg\:col-span-4 .text-gray-900,
.single .lg\:col-span-4 .text-\[14px\],
.single .lg\:col-span-4 .text-\[15px\] {
    font-family: 'DM Sans', 'Siemreap', sans-serif !important;
    font-size: 14.5px !important;
}

.single .lg\:col-span-4 .single-cpt-badge {
    font-family: 'Space Mono', 'Siemreap', monospace !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.single .lg\:col-span-4 a.inline-flex,
.single .lg\:col-span-4 button {
    font-family: 'Space Mono', 'Siemreap', monospace !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* High Contrast for Single Page Post Content */
.single .prose,
.single .prose p,
.single .prose li,
.single .prose ul,
.single .prose ol,
.single .prose strong,
.single .prose div,
.single .prose span {
    color: #111827 !important;
    /* solid gray-900 for high-contrast reading */
}

/* Headers should be even more solid and prominent */
.single .prose h1,
.single .prose h2,
.single .prose h3,
.single .prose h4,
.single .prose h5,
.single .prose h6 {
    color: #0f172a !important;
    /* Slate 900 */
}

/* Increase line spacing and decrease font size for main post titles on single pages */
.single main h1,
.single article h1,
.single .single-cpt-post-headline,
.single .single-cpt-post h1,
.single .cmdp-single-post h1 {
    line-height: 1.85 !important;
    /* Extra spacious line height for title readability */
    font-size: 1.45rem !important;
    /* Mobile size */
}

@media (min-width: 768px) {

    .single main h1,
    .single article h1,
    .single .single-cpt-post-headline,
    .single .single-cpt-post h1,
    .single .cmdp-single-post h1 {
        font-size: 1.85rem !important;
        /* Desktop size (decreased a little bit from 4xl) */
        line-height: 1.85 !important;
    }
}

/* Bilingual Brand Logo Header Layout & Text Spacing Configuration */
.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: 4px !important;
    padding-bottom: 4px !important;
}

body .header-logo-kh-title,
html body .header-logo-kh-title,
.glass-header .header-logo-kh-title {
    font-size: 11px !important;
    line-height: 1.3 !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
}

body .header-logo-en-title,
html body .header-logo-en-title,
.glass-header .header-logo-en-title {
    font-size: 8.5px !important;
    line-height: 1.2 !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
}

@media (min-width: 640px) {

    body .header-logo-kh-title,
    html body .header-logo-kh-title,
    .glass-header .header-logo-kh-title {
        font-size: 14.5px !important;
    }

    body .header-logo-en-title,
    html body .header-logo-en-title,
    .glass-header .header-logo-en-title {
        font-size: 10.5px !important;
    }
}

@media (min-width: 768px) {

    body .header-logo-kh-title,
    html body .header-logo-kh-title,
    .glass-header .header-logo-kh-title {
        font-size: 16px !important;
    }

    body .header-logo-en-title,
    html body .header-logo-en-title,
    .glass-header .header-logo-en-title {
        font-size: 11.5px !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.9375rem !important;
    /* ~16.5px on mobile */
    line-height: 1.65 !important;
}

@media (min-width: 768px) {

    .has-khmer-text:is(p, span, div),
    .card-has-khmer :is(p, span) {
        font-size: 1.0625rem !important;
        /* ~18.5px on desktop */
        line-height: 1.75 !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.8125rem !important;
    /* ~14px on mobile */
    line-height: 1.55 !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.875rem !important;
        /* ~15px on desktop */
        line-height: 1.6 !important;
    }
}

/* Global Responsive Article & Body Text System */
body,
p,
.prose p,
.prose li,
.entry-content p,
.single-cpt-post p {
    font-size: 1rem;
    /* ~17.5px on mobile */
    line-height: 1.75;
}

@media (min-width: 640px) {

    body,
    p,
    .prose p,
    .prose li,
    .entry-content p,
    .single-cpt-post p {
        font-size: 1.0625rem;
        /* ~18.5px on tablet */
        line-height: 1.8;
    }
}

@media (min-width: 1024px) {

    body,
    p,
    .prose p,
    .prose li,
    .entry-content p,
    .single-cpt-post p {
        font-size: 1.125rem;
        /* ~20px on desktop */
        line-height: 1.85;
    }
}

/* Ultra-Modern & Eye-Catching Comment Section Styling */
#respond,
.comment-respond {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 1.5rem !important;
    padding: 1.5rem !important;
    box-shadow: 0 10px 30px rgba(0, 48, 135, 0.06) !important;
    margin-top: 2rem !important;
    transition: all 0.3s ease !important;
}

@media (min-width: 768px) {

    #respond,
    .comment-respond {
        padding: 2.25rem !important;
    }
}

#respond:focus-within,
.comment-respond:focus-within {
    border-color: #003087 !important;
    box-shadow: 0 15px 40px rgba(0, 48, 135, 0.12), 0 0 0 4px rgba(0, 48, 135, 0.1) !important;
}

#reply-title {
    font-family: 'Open Sans', 'Siemreap', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 1rem !important;
}

#commentform textarea#comment,
.comment-form textarea {
    width: 100% !important;
    min-height: 140px !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 1rem !important;
    padding: 1rem 1.25rem !important;
    font-family: 'Open Sans', 'Siemreap', sans-serif !important;
    font-size: 1.0625rem !important;
    line-height: 1.7 !important;
    color: #1e293b !important;
    background-color: #f8fafc !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.25s ease-in-out !important;
}

#commentform textarea#comment:focus,
.comment-form textarea:focus {
    outline: none !important;
    background-color: #ffffff !important;
    border-color: #003087 !important;
    box-shadow: 0 0 0 4px rgba(0, 48, 135, 0.15) !important;
}

#commentform input[type="submit"],
.comment-form input[type="submit"],
#commentform .form-submit button {
    background: linear-gradient(135deg, #003087 0%, #0056b3 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    padding: 0.875rem 2rem !important;
    border-radius: 0.875rem !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(0, 48, 135, 0.25) !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

#commentform input[type="submit"]:hover,
.comment-form input[type="submit"]:hover,
#commentform .form-submit button:hover {
    background: linear-gradient(135deg, #002060 0%, #003087 100%) !important;
    box-shadow: 0 10px 28px rgba(0, 48, 135, 0.35) !important;
    transform: translateY(-1px) !important;
}

/* Global Modern Pagination & Active Tab System */
.page-numbers,
.pagination .page-numbers,
.cmdp-department-posts .page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    border-radius: 0.75rem !important;
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    margin: 0 0.25rem !important;
}

.page-numbers:hover,
.pagination a.page-numbers:hover {
    background-color: #003087 !important;
    color: #ffffff !important;
    border-color: #003087 !important;
    box-shadow: 0 4px 12px rgba(0, 48, 135, 0.2) !important;
}

.page-numbers.current,
.pagination .page-numbers.current,
span.page-numbers.current {
    background-color: #003087 !important;
    color: #ffffff !important;
    border-color: #003087 !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 14px rgba(0, 48, 135, 0.35) !important;
}




/* =========================================================================
   CUSTOM CARD BADGE WRAPPING & KHMER HEADER TEXT SIZE OPTIMIZATION
   ========================================================================= */

/* Wrap long taxonomy/category names on all cards to prevent overflow */
.news-card .absolute,
.fac-news-card .absolute,
.pub-card .absolute,
.pub-card-wrapper article .absolute {
    white-space: normal !important;
    max-width: 85% !important;
    word-break: break-word !important;
    display: inline-block !important;
    line-height: 1.25 !important;
    text-align: center !important;
}

/* Decrease Khmer header text size for all cards in homepage and faculty pages */
.news-card h4,
.fac-news-card h4,
.pub-card h3,
.pub-card-wrapper article h4 {
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
    font-weight: 800 !important;
}


/* Display card photos with cover and top alignment to prevent cutting heads */
article.news-card img,
article.fac-news-card img,
article.pub-card img,
.pub-card-wrapper img,
article img {
    object-fit: cover !important;
    object-position: top !important;
}

/* Make lecturer photos fit 100% inside the photo frame with top alignment (no blank margins, no cut-off heads) */
.leader-img,
.leader-img-container img,
#leaders-collapse-content img,
#depts-collapse-content img,
.ptec-lecturer-directory-template img,
.single-cm_lecturer img,
.cm-org-chart img,
.org-chart img,
.lecturer-card img,
.lecturer-photo img,
.lecturer-image img {
    object-fit: cover !important;
    object-position: top center !important;
    padding: 0 !important;
    transform: none !important;
}

/* =========================================================================
   MOBILE VIEW SCROLL-SNAP & CARD CENTERING OPTIMIZATIONS
   ========================================================================= */
@media (max-width: 767px) {
    /* Enable horizontal scroll-snapping on all mobile carousels */
    .carousel-container,
    .event-carousel-container,
    .pub-carousel-container,
    .local-carousel-container,
    .abroad-carousel-container,
    .mgt-carousel-container,
    .fac-carousel-container,
    .dept-head-carousel-container {
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-padding: 0 1rem !important;
    }

    /* Target items inside carousels to snap to the center of the viewport */
    .news-card,
    .event-card,
    .pub-card,
    .partner-card,
    .home-carousel-card,
    .faculty-card {
        scroll-snap-align: center !important;
    }

    /* Unified Mobile Card Title Scale */
    .partner-card h5,
    .partner-card p,
    .lecturer-card h4,
    .lecturer-card p,
    .news-card h4,
    .news-card h5,
    .event-card h4,
    .event-card h5,
    .pub-card h3,
    .pub-card h4,
    .faculty-card h3,
    .faculty-card h4,
    .partner-card .text-xl,
    .news-card .text-xl,
    .event-card .text-xl,
    .pub-card .text-xl,
    .lecturer-card .text-xl,
    .faculty-card .text-xl,
    h3.text-xl {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
    }

    /* Scale down taxonomy and department tags on mobile */
    .news-card span,
    .event-card span,
    .pub-card span,
    .partner-card span,
    .lecturer-card span,
    .faculty-card span,
    .news-card .absolute,
    .pub-card .absolute,
    .event-card .absolute,
    .badge,
    .tag {
        font-size: 8px !important;
        padding: 0.125rem 0.375rem !important;
    }
}