/* =====================================================
   main.css - วิทยาลัยอาชีวศึกษาวิริยาลัยนครสวรรค์
   ===================================================== */

/* ===== HERO BANNER / SWIPER ===== */
.hero-swiper {
    position: relative;
    /* ใช้ aspect-ratio แทน fixed height เพื่อ responsive จริง */
    width: 100%;
    height: clamp(240px, 36.45vw, 700px); /* 700/1920 = 36.45% */
    overflow: hidden;
}

.hero-swiper .swiper-slide {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}
.hero-swiper .slide-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 6s ease;
}
.hero-swiper .swiper-slide-active .slide-bg {
    transform: scale(1.05);
}
.hero-swiper .slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 97, 204, 0.82) 0%,
        rgba(14, 165, 233, 0.50) 50%,
        rgba(0, 97, 204, 0.28) 100%
    );
}
.hero-swiper .slide-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 clamp(16px, 4vw, 60px);
    z-index: 2;
}

/* Label */
.slide-label {
    display: inline-block;
    background: rgba(200, 150, 12, 0.9);
    color: #fff;
    font-size: clamp(10px, 1.2vw, 13px);
    font-weight: 600;
    padding: clamp(4px, 0.5vw, 6px) clamp(12px, 1.5vw, 20px);
    border-radius: 50px;
    margin-bottom: clamp(8px, 1vw, 16px);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: slideIn 0.6s ease 0.3s both;
}

/* Title */
.slide-title {
    font-size: clamp(1rem, 3vw, 3rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: clamp(8px, 1vw, 16px);
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.6s ease 0.5s both;
    max-width: 680px;
}

/* Subtitle */
.slide-subtitle {
    font-size: clamp(0.75rem, 1.5vw, 1.1rem);
    color: rgba(255,255,255,0.9);
    margin-bottom: clamp(12px, 2vw, 28px);
    animation: slideIn 0.6s ease 0.7s both;
    max-width: 550px;
    line-height: 1.6;
}

/* Button */
.slide-btn {
    animation: slideIn 0.6s ease 0.9s both;
}
.slide-btn .btn {
    font-size: clamp(11px, 1.2vw, 15px);
    padding: clamp(6px, 0.8vw, 12px) clamp(14px, 2vw, 28px);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pagination dots */
.hero-swiper .swiper-pagination-bullet {
    width: clamp(6px, 1vw, 10px);
    height: clamp(6px, 1vw, 10px);
    background: rgba(255,255,255,0.5);
    opacity: 1;
    transition: all 0.3s ease;
}
.hero-swiper .swiper-pagination-bullet-active {
    background: var(--secondary);
    width: clamp(18px, 2.5vw, 30px);
    border-radius: 5px;
}

/* Nav arrows */
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    width: clamp(32px, 4vw, 48px);
    height: clamp(32px, 4vw, 48px);
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    transition: all 0.3s ease;
}
.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}
.hero-swiper .swiper-button-next::after,
.hero-swiper .swiper-button-prev::after {
    font-size: clamp(10px, 1.5vw, 16px);
    font-weight: 900;
}

/* Mobile: ซ่อน subtitle และ label เพื่อไม่ให้ล้น */
@media (max-width: 480px) {
    .slide-label { display: none; }
    .slide-subtitle { display: none; }
    .hero-swiper .swiper-button-next,
    .hero-swiper .swiper-button-prev { display: none; }
}

/* ===== QUICK MENU ===== */
.quick-menu-section {
    padding: 40px 0;
    background: #fff;
    position: relative;
    z-index: 10;
    margin-top: -1px;
    box-shadow: var(--shadow-sm);
}
.quick-menu-wrap {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 30px 30px 20px;
    border: 1px solid var(--border-color);
}
.quick-menu-item {
    text-align: center;
    padding: 15px 10px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: block;
    border-radius: var(--radius);
}
.quick-menu-item:hover { transform: translateY(-5px); }
.quick-menu-item .icon-wrap {
    width: 64px; height: 64px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 26px;
    color: #fff;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.quick-menu-item .icon-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.quick-menu-item:hover .icon-wrap::before { transform: translateY(0); }
.quick-menu-item .label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    font-family: var(--font-secondary);
}

/* ===== NEWS SECTION ===== */
.news-section { padding: 80px 0; background: var(--bg-light); }

.news-tabs .nav-pills .nav-link {
    border-radius: 50px;
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
    padding: 8px 20px;
    transition: var(--transition);
    border: 2px solid transparent;
}
.news-tabs .nav-pills .nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(11,83,226,0.30);
}
.news-tabs .nav-pills .nav-link:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* News List Item */
.news-list-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}
.news-list-item:last-child { border-bottom: none; }
.news-list-item:hover { padding-left: 8px; }
.news-list-item .thumb {
    width: 80px; height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.news-list-item .thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.news-list-item:hover .thumb img { transform: scale(1.1); }
.news-list-item .info { flex: 1; min-width: 0; }
.news-list-item .info .date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.news-list-item .info .title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}
.news-list-item .info .title:hover { color: var(--primary); }

/* Featured News */
.news-featured {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 420px;
    cursor: pointer;
}
.news-featured img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.news-featured:hover img { transform: scale(1.04); }
.news-featured .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}
.news-featured .content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 30px;
    color: #fff;
}
.news-featured .category {
    background: var(--secondary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 10px;
}
.news-featured .title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}
.news-featured .meta { font-size: 13px; color: rgba(255,255,255,0.7); }

/* ===== STATISTICS ===== */
.stats-section {
    padding: 70px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
}
.stats-section::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.stats-section::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -80px;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.stat-card {
    text-align: center;
    color: #fff;
    padding: 30px 20px;
    position: relative;
    z-index: 2;
}
.stat-card .number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    color: var(--secondary-light);
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.stat-card .label {
    font-size: 15px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}
.stat-card .icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.3);
}
.stat-divider {
    width: 1px;
    background: rgba(255,255,255,0.2);
    margin: 20px 0;
}

/* ===== EVENTS / CALENDAR ===== */
.events-section { padding: 80px 0; background: #fff; }
.event-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 18px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
    margin-bottom: 16px;
}
.event-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}
.event-date-box {
    min-width: 60px;
    text-align: center;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
}
.event-date-box .day {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.event-date-box .month {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.event-info .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.4;
}
.event-info .meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ===== DEPARTMENTS ===== */
.departments-section { padding: 80px 0; background: var(--bg-section); }
.dept-card {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    height: 280px;
    cursor: pointer;
    transition: var(--transition);
}
.dept-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.dept-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.dept-card:hover img { transform: scale(1.08); }
.dept-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.2));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}
.dept-card .dept-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    margin-bottom: 10px;
    backdrop-filter: blur(4px);
}
.dept-card .dept-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.dept-card .dept-short {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

/* ===== VIDEO SECTION ===== */
.video-section { padding: 80px 0; background: var(--text-dark); position: relative; overflow: hidden; }
.video-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="%23ffffff08"/><circle cx="80" cy="80" r="1.5" fill="%23ffffff08"/></svg>') repeat;
}
.video-thumb {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
}
.video-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.video-thumb:hover img { transform: scale(1.04); }
.video-thumb .play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    transition: background 0.3s ease;
}
.video-thumb:hover .play-btn { background: rgba(0,0,0,0.5); }
.video-thumb .play-btn i {
    font-size: 56px;
    color: rgba(255,255,255,0.9);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    transition: transform 0.3s ease;
}
.video-thumb:hover .play-btn i { transform: scale(1.1); }

/* ===== ONLINE LINKS ===== */
.online-links-section { padding: 60px 0; background: #fff; }
.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid var(--border-color);
    background: #fff;
    height: 140px;
    gap: 12px;
}
.link-card:hover {
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}
.link-card .icon {
    font-size: 32px;
    transition: transform 0.3s ease;
}
.link-card:hover .icon { transform: scale(1.15); }
.link-card .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

/* ===== MANAGEMENT ===== */
.person-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
    padding: 30px 20px 24px;
}
.person-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}
.person-card .avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(11,83,226,0.25);
}
.person-card .name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.person-card .position {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}
.person-card .dept {
    display: inline-block;
    background: var(--bg-section);
    color: var(--primary);
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 50px;
    margin-top: 10px;
    font-weight: 600;
}

/* ===== DOWNLOAD ===== */
.download-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 12px;
}
.download-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}
.download-item .file-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}
.download-item .file-info { flex: 1; min-width: 0; }
.download-item .file-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.download-item .file-meta { font-size: 12px; color: var(--text-muted); }

/* ===== NEWS DETAIL ===== */
.article-body {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-dark);
}
.article-body h2, .article-body h3 { color: var(--primary); font-weight: 700; margin: 28px 0 14px; }
.article-body p { margin-bottom: 18px; }
.article-body img { border-radius: var(--radius); margin: 20px 0; }
.article-body blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg-section);
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 24px 0;
    font-style: italic;
}

/* ===== GALLERY / LIGHTBOX ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}
.gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.1); }

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }
.lightbox-overlay img { max-height: 90vh; max-width: 90vw; border-radius: var(--radius); }
.lightbox-close {
    position: absolute;
    top: 20px; right: 20px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ===== SEARCH RESULTS ===== */
.search-result-item {
    padding: 20px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    transition: var(--transition);
}
.search-result-item:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.search-result-item .result-title { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.search-result-item .result-excerpt { font-size: 14px; color: var(--text-muted); }
.search-result-item mark { background: rgba(200,150,12,0.25); color: var(--text-dark); padding: 1px 3px; border-radius: 3px; }

/* ===== PAGINATION ===== */
.pagination .page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 3px;
    color: var(--primary);
    border-color: var(--border-color);
    font-family: var(--font-secondary);
    transition: var(--transition);
}
.pagination .page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ===== ALERTS ===== */
.alert { border-radius: var(--radius); border: none; font-family: var(--font-secondary); }
.alert-success { background: rgba(46,204,113,0.1); color: #1a7a40; border-left: 4px solid #2ecc71; }
.alert-danger { background: rgba(231,57,70,0.1); color: #a01020; border-left: 4px solid var(--accent); }
.alert-warning { background: rgba(255,193,7,0.1); color: #856404; border-left: 4px solid #ffc107; }
.alert-info { background: rgba(11,83,226,0.08); color: var(--primary); border-left: 4px solid var(--primary); }

/* ===== FORM STYLES ===== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    padding: 10px 16px;
    font-family: var(--font-secondary);
    font-size: 15px;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11,83,226,0.15);
}
.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-family: var(--font-secondary);
}
.form-text { font-size: 12px; color: var(--text-muted); }

/* ===== TABLE ===== */
.table-custom { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-custom thead th {
    background: var(--primary);
    color: #fff;
    font-family: var(--font-secondary);
    font-weight: 600;
    border: none;
    padding: 14px 16px;
}
.table-custom tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-family: var(--font-secondary);
    border-color: var(--border-color);
}
.table-custom tbody tr:hover { background: var(--bg-section); }

/* ===== SHARE BUTTONS ===== */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.share-fb { background: #1877f2; color: #fff; }
.share-fb:hover { background: #166fe5; color: #fff; transform: translateY(-2px); }
.share-line { background: #00b900; color: #fff; }
.share-line:hover { background: #00a000; color: #fff; transform: translateY(-2px); }
.share-tw { background: #1da1f2; color: #fff; }
.share-tw:hover { background: #1a8cd8; color: #fff; transform: translateY(-2px); }
.share-copy { background: var(--text-muted); color: #fff; }
.share-copy:hover { background: #555; color: #fff; transform: translateY(-2px); }

/* ===== UTILITIES ===== */
.rounded-custom { border-radius: var(--radius); }
.shadow-custom { box-shadow: var(--shadow-md); }
.bg-gradient-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.text-primary-custom { color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.border-primary-custom { border-color: var(--primary) !important; }

/* ===== NO-IMAGE PLACEHOLDER ===== */
.img-placeholder {
    background: linear-gradient(135deg, var(--bg-section) 0%, var(--border-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 36px;
}

/* Animation Utilities */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg) !important; }
.fade-in { animation: fadeIn 0.5s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Responsive */
@media (max-width: 576px) {
    .stats-section .stat-card .number { font-size: 2.2rem; }
    .news-featured { height: 300px; }
    .dept-card { height: 220px; }
}