/*
Theme Name: Comsci Theme
Theme URI: https://comsci.rmutt.ac.th
Author: Computer Science RMUTT
Description: ธีมสำหรับสาขาวิทยาการคอมพิวเตอร์ มทร.ธัญบุรี
Version: 1.0
*/

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%; 
    background-color: #ffffff; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    position: sticky; 
    top: 0;
    z-index: 100;
    flex-wrap: wrap; 
}

.logo-text-container {
    display: flex;
    align-items: center;
    gap: 15px; 
}

.logo-area img {
    width: 80px;          
    height: 80px;         
    border-radius: 50%;   
    object-fit: cover;
    background-color: #ffffff;
    border: 2px solid #003366; 
    display: block;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #003366; 
    white-space: nowrap;
}

.hamburger {
    display: none;
    font-size: 28px;
    background: none;
    border: none;
    color: #003366;
    cursor: pointer;
    padding: 5px;
}

.top-nav {
    width: auto;
}

.top-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.top-nav li {
    border-right: 1px solid #e0e0e0; 
}

.top-nav li:last-child {
    border-right: none; 
}

.top-nav a {
    display: block;
    padding: 10px 18px; 
    color: #1a1a1a; 
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}

.top-nav a:hover {
    color: #007bff; 
}

.hero-banner {
    width: 100%;
    position: relative;
    background-color: #ffffff; 
}

.slider-container {
    width: 100%;
    height: 500px; 
    position: relative;
    overflow: hidden;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain; 
    object-position: center; 
    opacity: 0;
    transition: opacity 1s ease-in-out;
    cursor: pointer;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #ffffff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.close-modal:hover {
    color: #ff4d4d;
}

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;} 
    to {transform: scale(1); opacity: 1;}
}

.news-section {
    max-width: 100%; 
    margin: 60px auto 20px auto;
    padding: 0 5%; 
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
    text-align: left;
}

.news-tabs {
    border: 1px solid #e0e0e0;
    margin-bottom: 30px;
    background-color: #fcfcfc;
}

.news-tabs ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-tabs li {
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.news-tabs a {
    display: block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px; 
}

.news-tabs a:hover {
    background-color: #f0f8ff;
    color: #007bff;
}

.news-tabs a.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    background-color: #ffffff;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: start; 
}

.news-card {
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.news-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid #eaeaea;
}

.news-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
}

.news-meta span {
    color: #999;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    margin-bottom: 10px;
}

.limit-text img, .limit-text figure {
    display: none !important;
}

.limit-text {
    display: -webkit-box;
    -webkit-line-clamp: 5; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

.limit-text.expanded {
    -webkit-line-clamp: unset; 
}

.read-more-btn {
    background: none;
    border: none;
    color: #007bff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-align: left;
    margin-top: auto;
    transition: 0.2s;
}

.read-more-btn:hover {
    color: #0056b3;
    text-decoration: underline;
}

.knowledge-section {
    width: 100%;
    background-color: #ffffff; 
    padding: 60px 5%;
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 40px;
}

.knowledge-container-inner {
    max-width: 100%;
    margin: 0 auto;
}

.section-subtitle {
    color: #666;
    margin-top: -15px;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .knowledge-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .knowledge-section { padding: 40px 5%; }
    .knowledge-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .knowledge-grid { grid-template-columns: 1fr; }
}

.map-section-fullwidth {
    width: 100%;
    margin-top: 40px;
    margin-bottom: 0;
    line-height: 0;   
}

.map-section-fullwidth iframe {
    width: 100%;
    height: 500px;
    display: block;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05); 
}

.site-footer {
    background-color: #003366; 
    color: #ffffff;
    padding: 50px 5%;
    display: flex;
    justify-content: space-between; 
    align-items: flex-start;
    flex-wrap: wrap; 
    gap: 30px;
    margin-top: -5px; 
}

.footer-column {
    flex: 1;
    min-width: 250px; 
}

.footer-column h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #00ccff; 
}

.footer-column p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0e0e0; 
}

.contact-info p {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.contact-info a {
    color: #00ccff;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .top-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}

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

@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
    }
    
    .hamburger {
        display: block; 
    }

    .top-nav {
        display: none; 
        width: 100%;
        margin-top: 15px;
        background-color: #f9f9f9;
        border-radius: 8px;
    }

    .top-nav.show {
        display: block; 
    }

    .top-nav ul {
        flex-direction: column; 
        width: 100%;
    }

    .top-nav li {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        width: 100%;
    }

    .top-nav li:last-child {
        border-bottom: none;
    }

    .top-nav a {
        text-align: center; 
        padding: 15px;
    }

    .news-tabs ul {
        flex-wrap: nowrap; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
    }

    .news-tabs a {
        white-space: nowrap; 
        padding: 12px 20px;
    }

    .logo-area img {
        width: 60px;
        height: 60px;
    }
    .logo-text {
        font-size: 1.1rem; 
    }
    .slider-container {
        width: 100%; 
        left: 0; 
        height: 300px;
    }
    .news-grid {
        grid-template-columns: 1fr; 
    }
    .map-section-fullwidth iframe {
        height: 350px;
    }
    
    .site-footer {
        padding: 30px 5%;
        text-align: center;
    }
    .footer-column {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo-area img {
        width: 50px;
        height: 50px;
    }
    .slider-container {
        height: 200px;
    }
}

.single-page-section {
    width: 100%;
    background-color: #f9f9f9;
    padding: 60px 5%;
    min-height: 60vh; 
}

.page-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.page-title {
    font-size: 2rem;
    color: #003366;
    margin-bottom: 15px;
    text-align: center;
}

.title-divider {
    border: 0;
    height: 3px;
    background: #00ccff;
    width: 80px;
    margin: 0 auto 30px auto;
}

.page-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
}

.page-content h2, .page-content h3 {
    color: #003366;
    margin-top: 30px;
    margin-bottom: 15px;
}

.pdf-container {
    width: 100%;
    height: 80vh; 
    min-height: 500px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .pdf-container {
        height: 60vh; 
    }
}

.personnel-card {
    display: flex;
    flex-wrap: wrap;
    background-color: #ffffff;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eaeaea;
}

.personnel-image {
    flex: 0 0 250px; 
    background-color: #f4f4f4; 
}

.personnel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.personnel-info {
    flex: 1;
    padding: 30px;
    min-width: 300px;
}

.personnel-info h3 {
    font-size: 1.2rem;
    color: #1a1a1a;
    margin-bottom: 5px;
    font-weight: 600;
    margin-top: 0;
}

.personnel-info h4 {
    font-size: 1.1rem;
    color: #444;
    font-weight: 400;
    margin-bottom: 15px;
}

.personnel-info hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin-bottom: 15px;
}

.personnel-info p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.personnel-contact {
    margin: 20px 0;
}

.personnel-contact p {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.personnel-links p {
    margin-bottom: 5px;
    font-size: 0.9rem;
    word-break: break-all; 
}

.personnel-links a {
    color: #007bff;
    text-decoration: none;
}

.personnel-links a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .personnel-card {
        flex-direction: column;
    }
    .personnel-image {
        flex: 0 0 auto;
        width: 100%;
        height: 350px; 
    }
}