/* ===== ROOT VARIABLES ===== */
:root {
    --primary-pink: #E91E8C;
    --dark-pink: #C71585;
    --light-pink: #FF69B4;
    --black: #1a1a1a;
    --dark-gray: #2d2d2d;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --accent-gold: #FFD700;
    --text-dark: #333333;
    --text-light: #666666;
    --shadow: 0 10px 30px rgba(233, 30, 140, 0.15);
    --shadow-dark: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* ===== GLOBAL STYLES ===== */
* {
    
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    
    font-family: 'Trirong', serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--black);
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-pink), var(--dark-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2.5rem;
    color: var(--primary-pink);
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-pink), var(--dark-pink));
    border-radius: 2px;
}

h3 {
    font-size: 1.8rem;
    color: var(--dark-pink);
}

p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary-pink);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--dark-pink);
}

/* ===== HEADER & NAVIGATION ===== */
header {
   background: linear-gradient(
    to top,
    var(--dark-gray) 0%,
    #ffffff 5%
);

    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-section img {
    height: 70px;
    width: 60px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.school-info h1 {
    font-size: 1.2rem;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-pink), var(--dark-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.school-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}


/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--dark-gray) 0%, var(--black) 100%),
                url('../images/school-entrance.png') center 90% / cover no-repeat;
                background-attachment: fixed;
    background-blend-mode: overlay;
    color: var(--white);
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(233, 30, 140, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(199, 21, 133, 0.1) 0%, transparent 50%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(235, 220, 227, 0.35); /* 50% */
    z-index: 1;
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;          /* เพิ่มบรรทัดนี้ */
    text-align: center;      /* เพิ่มบรรทัดนี้ */
    animation: fadeInUp 1s ease;
}
.hero {
  position: relative;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;

    color: #ffffff;

    text-shadow:
        0 2px 6px rgba(0,0,0,0.7),
        0 0 15px rgba(255, 0, 120, 0.6);

    letter-spacing: 1px;
}

.hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    animation: slideInUp 0.8s ease 0.2s both;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeIn 1s ease 0.4s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.btn {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pink), var(--dark-pink));
    color: var(--white);
    box-shadow: 0 5px 20px rgba(233, 30, 140, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(233, 30, 140, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
}

.btn-secondary:hover {
    background: var(--primary-pink);
    color: var(--white);
    transform: translateY(-3px);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== SECTIONS ===== */
section {
    padding: 5rem 2rem;
}

.section-light {
    background-color: var(--light-gray);
}

.section-dark {
    background: linear-gradient(135deg, var(--dark-gray) 0%, var(--black) 100%);
    color: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    color: var(--primary-pink);
}

.section-title p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 1rem auto 0;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-pink);
    animation: fadeInUp 0.6s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-dark);
}

.card-dark {
    background: var(--dark-gray);
    color: var(--white);
    border-top-color: var(--light-pink);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-pink);
}

.card-dark .card-title {
    color: var(--light-pink);
}

/* ===== GRID ===== */
.grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    color: var(--white);
    padding: 3rem 2rem 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--light-pink);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}
.footer-section a:hover {
    color: #ffffff;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    section {
        padding: 3rem 1rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(233, 30, 140, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(233, 30, 140, 0.8);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-pink {
    color: var(--primary-pink);
}

.text-white {
    color: var(--white);
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }
.p-3 { padding: 3rem; }

.rounded {
    border-radius: 10px;
}

.shadow {
    box-shadow: var(--shadow);
}

/* ===== STAFF SECTION ===== */
.staff-link {
    text-align: center;
    margin-top: 2rem;
}

.staff-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.staff-stat {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    animation: fadeInUp 0.6s ease;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--light-pink);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: rgba(219, 35, 167, 0.8);
}
.stat-label-2 {
    font-size: 1rem;
    color: rgba(254, 254, 254, 0.936);
}
.hero-title {
    display: inline-block;
    padding: 18px 60px;

    font-size: 1.2rem;
    font-weight: 550;
    text-align: center;

    color: #ffffff;

    background: 
        linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)) padding-box,
        linear-gradient(
            135deg,
            #fff8dc,
            #ffd700,
            #ffcc00,
            #ffd700,
            #fff8dc
        ) border-box;

    border: 4px solid transparent;
    border-radius: 60px;

    box-shadow:
        0 0 25px rgba(255, 215, 0, 0.7),
        0 10px 30px rgba(0,0,0,0.4);
}
/* ===== GALLERY SECTION ===== */

.gallery-preview {
    display: flex;
  flex-direction: column;   /* เรียงลงแนวตั้ง */
  gap: 20px;
  width: 100%;
  height: auto;        /* สำคัญมาก */
  object-fit: contain; /* ไม่ตัดภาพ */

}

.gallery-item {
    height: auto;      /* เอา 600px ออก */
    overflow: visible; /* ไม่ซ่อนภาพ */
}

.gallery-item img {
    width: 100%;
    height: auto;          /* สำคัญมาก */
    object-fit: contain;   /* ไม่ตัดภาพ */
}
.gallery-link {
    text-align: center;
}
.sub-name {
    font-size: 0.8em;
    font-weight: normal;
}
/* ===== เปิด-ปิด โหมดไว้อาลัยตรงนี้ ===== */
body[data-mourning="on"]  {    
    filter: grayscale(60%) brightness(95%);
}  

/* ===== Mourning Ribbon Fixed Bottom Right ===== */

.mourning-ribbon {
    position: fixed !important;
    bottom: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    pointer-events: none;
}

.mourning-ribbon img {
    width: 140px;
    height: auto;
    display: block;
}
.students-link {
    text-align: center;
}
.staff-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 1%;   /* 👈 ปรับตำแหน่งรูป */
    border-radius: 50%;
}
.hero-section {
  position: relative;
  background: url("images/your-background.jpg") center/cover no-repeat;
  height: 500px;   /* ปรับความสูงตามต้องการ */
}

/* กล่องวิดีโอที่ซ้อนอยู่ */
.hero-section {
  position: relative;
  height: 500px; /* ปรับตามความสูงภาพ */
}

/* วิดีโอซ้อน */
.video-overlay {
  position: absolute;
  bottom: -60px;   /* อย่าใช้ค่าติดลบก่อน */
  right: -7px;
  width: 350px;
  z-index: 3;    /* สูงกว่าทุกอย่าง */
}

.video-overlay iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  border: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.video-overlay1 {
  position: absolute;
  bottom: -500px;   /* อย่าใช้ค่าติดลบก่อน */
  right: 500px;
  width: 350px;
  z-index: 3;    /* สูงกว่าทุกอย่าง */
}

.video-overlay1 iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  border: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
/* ให้ข้อความอยู่เหนือ */
.hero-content {
  position: relative;
  z-index: 10;
}
/* ===== TOP BAR ===== */
.top-bar {
  background: #2d2d2d;
  color: white;
  font-size: 14px;
}

.top-bar-container {
  max-width: 1200px;
  margin: auto;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.social-icons a {
  color: white;
  margin-right: 15px;
  font-size: 15px;
  transition: 0.3s;
}

.social-icons a:hover {
  color: #ff4da6;
}

.top-contact a {
  color: white;
  margin-left: 15px;
  text-decoration: none;
}

.top-contact a:hover {
  color: #ff4da6;
}

/* มือถือ */
@media (max-width: 768px) {
  .top-bar-container {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }
}
/* ปุ่มเมนู ☰ */
.menu-toggle {
    font-size: 30px;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 20px;
    color: #333333;
    z-index: 2001;
}

/* เมนูด้านข้าง */
.side-menu {
    position: fixed;
    top: 140px;          /* ให้เริ่มใต้ header */
    right: -250px;
    width: 150px;
    height: calc(100% - 140px);  /* ลบความสูง header ออก */
    background: #FF69B4;
    padding-top: 20px;
    transition: 0.4s;
    z-index: 2000;
}

.side-menu a {
    display: block;
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    font-size: 17px;
}

.side-menu a:hover {
    background: #e91e63;
}

/* แสดงเมนูเมื่อเปิด */
.side-menu.active {
    right: 0;
}
.header-container {
    position: relative;
}

@media (max-width: 768px) {
    .hero {
        background-attachment: scroll;
    }
}
/* ===== HERO BASE ===== */
/* ================= HERO CLEAN VERSION ================= */

/* โครงหลัก */
.hero {
    height: 65vh;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* overlay */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}

/* ข้อความ */
.hero-overlay {
    position: relative;
    z-index: 2;
    color: white;
}

/* รูปเฉพาะหน้า About */
.hero-about {
    background-image: url('../images/about.jpg');
}

/* มือถือ */
@media (max-width: 768px) {
    .hero {
        height: 40vh;              /* ลดความสูง */
        background-attachment: scroll;
        background-size: cover;    /* ไม่ใช้ contain จะได้ไม่เห็นขอบดำ */
        background-position: center top;
    }

    .hero::after {
        background: rgba(0,0,0,0.25);
    }
}
.footer-section a {
    position: relative;
    z-index: 10;
    display: inline-block;
}
.home-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
 /* จำนวนผู้เข้าชม */
@media (max-width: 768px) {
  .top-bar-container {
    flex-direction: row;
    justify-content: space-between;
  }

  .visitor-counter {
    font-size: 12px;
  }
}