/* ==========================================================================
   1. Global Variables & Body
   ========================================================================== */

   :root {
    --primary: #cbb7d3;
    --secondary: #f6f1fa;
    --dark: #222;
    --almost-black: #232024;
    --card1: #e5d6ef;
    --card2: #f8e3e7;
    --card3: #dae7df;
  }
  
  body {
    font-family: 'Georgia', 'Times New Roman', serif;
    margin: 0;
    color: var(--dark);
    background: #fff;
    line-height: 1.6;
    padding-top: 150px; /* Match the desktop navbar's height */
  }
  
  /* ==========================================================================
     2. Navbar
     ========================================================================== */
  
  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 0 3vw;
    height: 150px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .nav-left {
    display: flex;
    align-items: center;
  }
  
  .school-logo {
    width: 250px;
    height: 250px;
    margin-right: 18px;
    object-fit: contain;
  }
  
  .school-name {
    font-size: 1.7em;
    color: #8f6ba3;
    font-weight: bold;
    letter-spacing: 2px;
  }
  
  .anniversary-logo {
    width: 80px;
    height: auto;
    margin-left: 12px;
    object-fit: contain;
  }
  
  /* Navbar Animations */
  .school-name {
    opacity: 0;
    filter: blur(4px);
    animation: blurClear 1.5s ease-in forwards;
  }
  
  .anniversary-logo {
    opacity: 0;
    filter: blur(4px);
    animation: blurClear 1.5s ease-in forwards;
    animation-delay: 0.5s;
  }
  
  @keyframes blurClear {
    to {
      opacity: 1;
      filter: blur(0);
    }
  }
  
  .nav-right {
    display: flex;
    gap: 32px;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .nav-right a {
    color: #8f6ba3;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    transition: color 0.2s;
  }
  
  .nav-right a:hover {
    color: #c281c2;
  }
  
  /* ==========================================================================
     3. General & Banner Section
     ========================================================================== */
  
  .section-line {
    border: none;
    border-top: 1.5px solid #e1d2e7;
    margin: 0;
  }
  
  .banner-section {
    background: var(--primary);
    min-height: 400px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0;
  }
  
  .banner-slider {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
  }
  
  .slide {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 340px;
    transition: opacity 0.5s;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
  }
  
  .banner-img-wrapper {
    width: 600px;
    height: 340px;
    flex-shrink: 0;
    border-radius: 36px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 40px #0002;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 100px;
    margin-right: 40px;
  }
  
  .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .banner-content {
    margin-left: 5px;
    padding: 36px 38px;
    border-radius: 18px;
    min-width: 300px;
    max-width: 420px;
  }
  
  .banner-content h1 {
    color: #402758;
    font-size: 2.4em;
    font-weight: 700;
    margin: 0 0 12px 0;
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .banner-content p {
    color: #5b456a;
    font-size: 1.1em;
    margin: 0;
  }
  
  .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff8;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3em;
    color: #8f6ba3;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .arrow:hover {
    background: #fff;
  }
  
  .arrow.left {
    left: 12px;
  }
  .arrow.right {
    right: 12px;
  }
  
  /* ==========================================================================
     4. Video Section
     ========================================================================== */
  
  .video-section {
    background: var(--secondary);
    padding: 60px 0;
    text-align: center;
  }
  
  .video-section h2 {
    font-size: 2em;
    color: #8f6ba3;
    letter-spacing: 1px;
    margin-bottom: 36px;
  }
  
  .video-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
  }

  .video-item-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px; /* Space between video and its description */
  }
  
  .video-box {
    width: 600px;
    height: 340px;
    margin: 0 auto;
    position: relative;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 6px 40px #0002;
    cursor: pointer;
  }

  .video-box2 {
    width: 600px;
    height: 340px;
    margin: 0 auto;
    position: relative;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 6px 40px #0002;
    cursor: pointer;
  }
  
  #play-toggle {
    display: none;
  }
  
  .video-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: red;
    border-radius: 50%;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
  }
  
  .play-button::before {
    content: "";
    display: block;
    margin-left: 6px;
    width: 0;
    height: 0;
    border-left: 28px solid #fff;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
  }
  
  .video-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 36px;
    box-shadow: 0 6px 40px #0002;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
  }
  
  #play-toggle:checked ~ .video-cover,
  #play-toggle:checked ~ .play-button {
    display: none;
  }
  #play-toggle:checked ~ .video-frame {
    display: block;
  }
  
  .video-box iframe {
    width: 100%;
    height: 100%;
    border: none;
  }
  
  .video-content {
    margin-top: 12px;
    padding: 20px 100px;
    border-radius: 18px;
    max-width: 600px;
    background: #f8f3fd;
    color: #542e71;
    box-shadow: 0 6px 22px #0001;
    text-align: center;
  }
  
  .video-content h3 {
    color: #8f6ba3;
    margin: 0 0 12px 0;
    font-size: 1.3em;
  }
  
  .video-content p {
    margin: 0;
    font-size: 1.2em;
  }
  
  /* ==========================================================================
     5. Gallery Section
     ========================================================================== */
  
  .gallery-section {
    background: #fff;
    padding: 68px 0;
    text-align: center;
  }
  
  .gallery-section h2 {
    color: #8f6ba3;
    font-size: 2em;
    letter-spacing: 1px;
    margin-bottom: 36px;
  }
  
  .gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .gallery-card {
    width: 240px;
    background: var(--card1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 18px #0001;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .card-color1 { background: var(--card1); }
  .card-color2 { background: var(--card2); }
  .card-color3 { background: var(--card3); }
  
  .img-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
  }
  
  .img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .gallery-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 2px solid #fff;
    background: #fff;
  }
  
  .date-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    text-align: left;
    padding: 7px 0 0 14px;
    font-size: 1.18em;
    color: #ffffff;
    font-weight: bold;
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 2px 8px #fff9;
    letter-spacing: 1px;
  }
  
  .card-desc {
    padding: 18px 12px;
    text-align: center;
  }
  
  .card-desc h4 {
    margin: 0 0 8px 0;
    color: #7a4ea7;
    font-size: 1.1em;
    font-weight: bold;
  }
  
  .card-desc p {
    margin: 0;
    color: #5b456a;
    font-size: 0.98em;
  }
  
  /* ==========================================================================
     6. Dolls Section
     ========================================================================== */
  
  .dolls-section {
    background: var(--primary);
    min-height: 200px;
    position: relative;
    overflow: hidden;
    padding: 60px 0;
  }
  
  .dolls-slide {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 0 8vw;
    gap: 40px;
    text-align: right;
  }
  
  .dolls-slide.active {
    display: flex;
  }
  
  .dolls-content {
    flex: 0 0 420px;
    max-width: 420px;
  }
  
  .dolls-content h1 {
    font-size: 2.4em;
    color: #402758;
    margin-bottom: 12px;
  }
  
  .dolls-content p {
    font-size: 1.1em;
    color: #402758;
  }
  
  .dolls-img-wrapper {
    flex: 0 0 600px;
    width: 600px;
    height: 340px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 40px #0002;
    background: #fff;
  }
  
  .dolls-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .arrow.dolls-left { left: 12px; }
  .arrow.dolls-right { right: 12px; }
  
  /* ==========================================================================
     7. Standalone Card Component ("願景目標")
     ========================================================================== */
  
  .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 60px 0;
    text-align: center;
  }
  
  h1, .container h1 {
    color: #8f6ba3;
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 36px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .cards {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 70px;
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .card {
    display: flex;
    flex-direction: column;
    width: 200px;
    height: 300px;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    flex: 1 1 auto;
    min-width: 200px;
    color: #402758;
  }
  
  .card.pink { background-color: #ffd1dc; }
  .card.yellow { background-color: #f9e5a8; }
  .card.blue { background-color: #b4d3ff; }
  
  .card h2 {
    font-size: 1.5em;
    margin: 5px 0;
  }
  
  .card p {
    font-size: 1.2em;
    color: #8f6ba3;
    margin: 10px 10px;
  }
  
  .card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
  }
  
  /* ==========================================================================
     8. Footer
     ========================================================================== */
  
  .footer {
    background: #cbb7d3;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 26px 5vw;
    font-size: 1.12em;
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .footer-left {
    font-weight: 500;
    letter-spacing: 0.5px;
  }
  
  .footer-right a {
    color: #fff;
    font-size: 1.6em;
    margin-left: 20px;
    transition: color 0.2s;
  }
  
  .footer-right a:hover {
    color: #ffddee;
  }
  
  /* ==========================================================================
     9. Responsive Design (RWD)
     ========================================================================== */
  
  /* 手機 RWD: 600px and below */
  @media (max-width: 600px) {
    body {
      padding-top: 130px; /* Increased top padding */
    }
  
    h1, .container h1, .video-section h2, .gallery-section h2 {
      font-size: 1.6em;
    }
  
    /* Navbar */
    .navbar {
      flex-direction: column;
      align-items: flex-start;
      height: auto;
      padding: 8px 3vw;
      gap: 0;
      padding-top: 20px;
    }
  
    .nav-left {
      width: 100%;
      justify-content: flex-start;
      margin-bottom: 6px;
    }
  
    .school-logo {
      width: 100px;
      height: 38px;
      margin-right: 10px;
      margin-left: 10px;
    }
  
    .school-name {
      font-size: 1em;
      letter-spacing: 1px;
      white-space: nowrap;
    }
    
    .anniversary-logo {
      width: 32px;
      margin-left: 6px;
    }
  
    .nav-right {
      width: 100%;
      justify-content: space-around;
      gap: 0;
      flex-wrap: nowrap;
      margin-bottom: 6px;
    }
  
    .nav-right li {
      flex: 1 0 auto;
      min-width: auto;
      text-align: center;
    }
  
    .nav-right a {
      font-size: 0.88em; /* Slightly smaller nav text */
      padding: 6px 2px;
      display: block;
    }
  
    /* Banner Section */
    .banner-section {
      min-height: 400px; /* Fixed min-height to prevent jumping */
      padding: 20px 0;
      display: flex;
      align-items: center; /* Vertically center content */
    }
  
    .banner-slider {
      min-height: unset;
    }
  
    .slide {
      position: relative;
      flex-direction: column;
      min-height: unset;
      width: 100%;
      gap: 16px;
      justify-content: center;
    }
  
    .banner-img-wrapper {
      width: 90vw;
      height: 250px;
      margin: 0;
      border-radius: 20px;
    }
  
    .banner-content {
      margin: 0;
      padding: 0;
      max-width: 90vw;
      text-align: center;
    }
  
    .banner-content h1 {
      font-size: 1.4em; /* Smaller text */
      align-items: center;
    }
  
    .banner-content p {
      font-size: 0.9em; /* Smaller text */
    }
    
    .arrow {
      top: 30%; /* Adjusted arrow position */
    }
  
    /* Video Section */
    .video-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 24px;
    }

    .video-box {
      width: 90vw;
      height: auto;
      aspect-ratio: 16 / 9;
      border-radius: 20px;
    }

    .video-box2 {
      width: 90vw;
      height: auto;
      aspect-ratio: 16 / 9;
      border-radius: 20px;
    }
  
    .video-content {
      width: 90vw;
      box-sizing: border-box;
      padding: 16px;
      font-size: 0.95em;
    }
  
    /* "願景目標" Cards Section */
    .cards {
      flex-direction: column;
      gap: 20px;
      margin-bottom: 40px;
      padding: 0 5vw;
      box-sizing: border-box;
    }
  
    .card {
      width: 100%;
      height: auto;
      padding: 15px; /* Smaller padding */
      max-width: 320px;
      margin: 0 auto;
    }
  
    .card h2 {
      font-size: 1.3em; /* Smaller title */
    }
  
    .card p {
      font-size: 1.1em; /* Smaller text */
    }
  
    .card img {
      height: 160px; /* Smaller image */
    }
  
    /* Gallery Section */
    .gallery-grid {
      gap: 18px;
      padding: 0 5vw;
    }
    .gallery-card {
      width: 100%;
      max-width: 350px;
      border-radius: 10px;
    }
    .img-wrapper, .gallery-card img {
      height: 180px;
    }
  
    /* Dolls Section */
    .dolls-slide {
      flex-direction: column-reverse;
      text-align: center;
      padding: 20px 10px;
      gap: 20px;
    }
    .dolls-content {
      flex: none;
      max-width: 100%;
    }
    .dolls-img-wrapper {
      flex: none;
      width: 100%;
      height: 190px;
      aspect-ratio: 16 / 9;
    }
  
    /* Footer */
    .footer {
      flex-direction: column;
      align-items: center;
      gap: 12px;
      padding: 20px 3vw;
      text-align: center;
      font-size: 0.9em; /* Smaller base font */
    }
    .footer-right {
      margin-top: 8px;
    }
    .footer-right a {
      font-size: 1.5em; /* Smaller icons */
      margin-left: 15px;
    }
  }
  
  /* 極窄屏幕 (390px and below) */
  @media (max-width: 390px) {
    body {
      padding-top: 125px;
    }
  
    .school-name {
      font-size: 0.92em;
    }
    .nav-right a {
      font-size: 0.82em;
    }
  
    .banner-content h1 {
      font-size: 1.3em;
    }
    
    .img-wrapper, .gallery-card img {
      height: 150px;
    }
  }