.celebrate {
  --celebrate-bg: #fffdeb;
  --celebrate-border: #d8e0f2;
  --celebrate-border-muted: #d7dbe7;
  --celebrate-envelope-back: #cbb92f;
  --celebrate-envelope-front: #fce763;
  --celebrate-envelope-top: #c9b02e;
  --celebrate-hero-accent: #e8891d;
  --celebrate-hero-box: #fff4e5;
  --celebrate-hero-text: #7b4b33;
  --celebrate-pagination-active: #2b4b8d;
  --celebrate-pagination-disabled-border: #e2e6f0;
  --celebrate-pagination-disabled-text: #b5bccb;
  --celebrate-panel: #fefadf;
  --celebrate-shadow-soft: rgba(46, 69, 128, 0.08);
  --celebrate-shadow-strong: rgba(46, 69, 128, 0.12);
  --celebrate-shadow: rgba(0, 0, 0, 0.1);
  --celebrate-text-muted: #8c93a3;
  background-color: var(--celebrate-bg);
  overflow: hidden;
}

.celebrate-hero {
  background-color: var(--celebrate-bg);
  padding: 80px 0 60px;
  margin-bottom: -2px;
}

.tegami-wrap {
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}


.tegami {
  background-color: #ffffff;
  border-radius: 28px;
  box-shadow: 4px 4px 4px 0 rgba(0, 0, 0, 0.25);
  margin: 0 auto;
  max-width: 1440px;
  padding: 48px 64px 160px;
  --tegami-pad-x: 48px;
  --card-overhang-x: 30px;
  --card-overhang-y: 3px;
  width:100%;
  z-index: 1;
  position:relative;
}

.celebrate-hero__inner {
  align-items: center;
  column-gap: 24px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(360px, 1.4fr) minmax(180px, 1fr);
  justify-items: center;
  margin: 0 auto;
  row-gap: 48px;
  width: 100%;
}

.celebrate-hero__decor {
  transform: translateY(-140px);
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.celebrate-hero__decor img {
  height: auto;
  max-width: 260px;
  width: 100%;
}

.celebrate-message-card {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  aspect-ratio: auto;
}

.celebrate-message-card .message-card {
  aspect-ratio: auto;
  height: auto;
  max-width: none;
  width: 100%;
  /* Added specific styles for hero cards */
  background-color: var(--message-card-accent);
  color: #ffffff;
  box-shadow: none;
  border: none;
}

.celebrate-message-card .message-card__title,
.celebrate-message-card .message-card__text {
  color: #ffffff;
}

.celebrate-message-card .message-card__kuti {
  bottom: -17px;
  width: 20px;
  height: 20px;
}

.celebrate-message-card--left .message-card__kuti {
  left: 25%;
}

.celebrate-message-card--right .message-card__kuti {
  right: 25%;
  left: auto;
}



.celebrate-message-card--left {
    transform: translateX(-60px);
}

.celebrate-message-card--right {
    transform: translateX(60px);
}


.celebrate-hero__box {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 40px;
  text-align: center;
}

.celebrate-hero__top {
  background-color: #fff8e8;
  border-radius: 18px;
  color: #7b4b33;
  padding: 28px 32px;
  text-align: center;
  width: 52vw;
  max-width: 800px;
}

.celebrate-hero__eyebrow {
  color: var(--celebrate-hero-text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.celebrate-hero__title {
  color: var(--celebrate-hero-text);
  font-size: var(--font-size-heading-l);
  line-height: 1.3;
  margin: 0 0 12px;
}

.celebrate-hero__title-line {
  color: var(--celebrate-hero-text);
}

.celebrate-hero__title-line--accent {
  color: #e8891d;
}

.celebrate-hero__period {
  color: var(--celebrate-hero-text);
  font-size: var(--font-size-heading-m);
  font-weight: 700;
  margin: 0;
}

.celebrate-hero__period--accent{
  font-size: var(--font-size-heading-m);
}

.celebrate-body__lead,
.celebrate-body__intro,
.celebrate-body__notes {
  color: var(--blue-primary);
}

.celebrate-body__lead {
  margin: 0;
  max-width: 560px;
}

.celebrate-body__lead p {
  line-height: 1.8;
  margin: 0;
  color: var(--blue-primary);
}

.celebrate-body__lead p + p {
  margin-top: 12px;
}

.celebrate-body__intro {
  line-height: 1.8;
  margin: 0;
  max-width: 520px;
}

.celebrate-body__cta {
  margin: 6px 0;
}

.celebrate-button {
  align-items: center;
  background-color: #fce761;
  border: 2px solid #2e4580;
  border-radius: 999px;
  box-shadow: 0 6px 0 #2e4580;
  color: #2e4580;
  display: inline-flex;
  font-size: 16px;
  font-weight: 700;
  gap: 12px;
  padding: 14px 32px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.celebrate-button:hover {
  box-shadow: 0 3px 0 #2e4580;
  transform: translateY(3px);
}

.celebrate-button__icon img {
  display: block;
  height: 22px;
  width: 22px;
}

.celebrate-body__notes {
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.celebrate-body__notes p {
  font-size: 14px;
  margin: 0;
  color: var(--blue-primary);
}

.celebrate-body__notes p + p {
  margin-top: 6px;
}


.layer-back-haikei{
  align-items: flex-start;
  display: flex;
  justify-content: center;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 100%;
  z-index: 0;
  height: 100vh;
  height: 100dvh; /* iOS Safari対応: dynamic viewport height */
}

.layer-back-haikei img {
  height: auto;
  margin-top: -120px;
  max-width: none;
  width: 100vw;
}

/* 共通設定：配置と基本動作 */
.layer-front,
.layer-back {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}

/* 背面レイヤー */
.layer-back {
     translate: 0 -50px;
  z-index: 1;
  top: 0;
  height: 100%;
  background-color: #C6AF1E;
  clip-path: polygon(50% 0%, 100% 40%, 100% 100%, 0% 100%, 0% 40%);
}

/* 前面レイヤー */
.layer-front {
  height: 400px;
  z-index: 3;
  bottom: -60px;
  aspect-ratio: 1600 / 406; /* 横幅に対する高さの比率 */
  background-color: var(--celebrate-envelope-front);
  clip-path: polygon(0 0, 50% 80%, 100% 0, 100% 100%, 0 100%);
}

.celebrate-search-results{ 
    /* translate: 0 0px; */ /* 位置の微調整 */
    z-index: 3;
    position: relative;
    background-color: var(--celebrate-envelope-front);}


.celebrate-search-results {
  --message-card-gap: 38px;
  --message-card-gap-x: 24px;
  background-color: var(--celebrate-envelope-front);
  padding: 0 24px 104px;
}

.celebrate-search-results__inner {  
 
  border-radius: 28px;
  box-shadow: 0 10px 0 var(--celebrate-shadow-soft);
  margin: -104px auto 0;
  width: 100%;
  padding: 80px 24px;
  max-width: 1520px;
}



/* 検索結果件数 */
.search-results__count {
  max-width: 1232px;
  margin: 0 auto 32px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #eaf6fc 0%, #f0f4ff 100%);
  border-radius: 6px;
  font-family: var(--main-font-family);
  font-size: var(--font-size-m);
  font-weight: 500;
  color: var(--blue-primary);
}
.search-results__count-num {
  font-size: var(--font-size-heading-m);
  font-weight: 700;
  color: #2CA9E3;
  margin: 0 2px;
}

/* 検索結果なし */
.search-results__empty {
  max-width: 1232px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
  border-radius: 8px;
}
.search-results__empty-text {
  font-family: var(--main-font-family);
  font-size: var(--font-size-l);
  font-weight: 700;
  color: var(--blue-primary);
  margin: 0 0 8px;
}
.search-results__empty-sub {
  font-family: var(--main-font-family);
  font-size: var(--font-size-s);
  color: #6b7280;
  margin: 0;
}

/* 検索結果リスト（Gridレイアウト） */
.search-results__lists {
  display: grid;
  gap: var(--message-card-gap) var(--message-card-gap-x);
  grid-template-columns: repeat(3, 1fr);
  justify-content: center;
  justify-items: stretch;
  list-style: none;
  margin: auto;
  max-width: 1232px;
  padding: 0;
}

.search-results__list {
  max-width: 380px;
  width: 100%;
}

/* カード表示アニメーション */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-results__list {
  opacity: 0;
}

.search-results__list.is-revealed {
  animation: cardReveal 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.search-results__list .message-card {
  height: 260px;
  max-width: none;
  width: 100%;
}

/* 検索結果カードの配色オーバーライド（ユーザー指定による変更） */
.celebrate-search-results .message-card--student {
  /* color/blue/120 correspond to student-primary */
  --message-card-accent: var(--student-primary);
}

.celebrate-search-results .message-card--parent {
  /* color/green/100 correspond to parent-primary */
  --message-card-accent: var(--parent-primary);
}

.celebrate-search-results .message-card--graduate {
  --message-card-accent: var(--graduate-primary);
	--message-card-secondary: var(--graduate-secondary);
}

.celebrate-search-results .message-card--university {
  /* color/yellow/120 correspond to university-primary */
  --message-card-accent: var(--university-primary);
}

.celebrate-search-results .message-card--other {
  /* color/pink/100 correspond to other-primary */
  --message-card-accent: var(--other-primary);
}

.celebrate-search-results .message-card--staff {
  /* color/orange/100 correspond to staff-primary */
  --message-card-accent: var(--staff-primary);
}


/* ページネーション */
.celebrate-search-results .ajax-pagination {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 32px;
}

.celebrate-search-results .ajax-pagination .page-numbers {
  align-items: center;
  background-color: var(--white);
  border: 1px solid var(--celebrate-border-muted);
  border-radius: 6px;
  color: var(--celebrate-text-muted);
  display: inline-flex;
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-bold);
  height: 36px;
  justify-content: center;
  line-height: 1;
  min-width: 36px;
  padding: 0 10px;
  text-decoration: none;
  transition: var(--transition-animation);
}

.celebrate-search-results .ajax-pagination .page-numbers:hover {
  border-color: var(--celebrate-pagination-active);
  color: var(--celebrate-pagination-active);
}

.celebrate-search-results .ajax-pagination .page-numbers.current {
  background-color: var(--celebrate-pagination-active);
  font-family: sans-serif;
  border-color: var(--celebrate-pagination-active);
  color: var(--white);
}

.celebrate-search-results .ajax-pagination .page-numbers.next {
  min-width: 56px;
  padding: 0 16px;
}

.celebrate-search-results .ajax-pagination .page-numbers.is-disabled {
  border-color: var(--celebrate-pagination-disabled-border);
  color: var(--celebrate-pagination-disabled-text);
  cursor: not-allowed;
  pointer-events: none;
}

/* the_posts_pagination() 用 */
.celebrate-search-results .navigation.pagination {
  margin-top: 64px;
}

.celebrate-search-results .navigation.pagination .nav-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.celebrate-search-results .navigation.pagination .page-numbers {
  align-items: center;
  background-color: var(--white);
  border: 1px solid var(--celebrate-pagination-active);
  border-radius: 6px;
  color: var(--celebrate-pagination-active);
  display: inline-flex;
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-bold);
  height: 48px;
  justify-content: center;
  line-height: 1;
  min-width: 48px;
  padding: 0 10px;
  text-decoration: none;
  transition: var(--transition-animation);
}

.celebrate-search-results .navigation.pagination .page-numbers:hover {
  border-color: var(--celebrate-pagination-active);
  color: var(--celebrate-pagination-active);
}

.celebrate-search-results .navigation.pagination .page-numbers.current {
  background-color: var(--celebrate-pagination-active);
  font-family: sans-serif;
  border-color: var(--celebrate-pagination-active);
  color: var(--white);
}

.celebrate-search-results .navigation.pagination .page-numbers.next {
  min-width: 56px;
  padding: 0 16px;
}

.celebrate-search-results .navigation.pagination .page-numbers.dots {
  border: none;
  background: none;
  min-width: auto;
  padding: 0;
}
    

@media screen and (max-width: 1024px) {
  .tegami {
    padding: 48px 32px 160px;
    --tegami-pad-x: 32px;
  }

  .celebrate-hero__inner {
    grid-template-columns: 1fr;
    position: relative;
  }

  .celebrate-hero__box {
    position: relative;
  }

  .celebrate-hero__decor.celebrate-hero__decor--left,
  .celebrate-hero__decor.celebrate-hero__decor--right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }

  .celebrate-hero__decor.celebrate-hero__decor--left {
    left: 0;
  }

  .celebrate-hero__decor.celebrate-hero__decor--right {
    right: 0;
  }

  .celebrate-hero__decor img {
    max-width: 160px;
  }




  .celebrate-message-card.celebrate-message-card--left,
  .celebrate-message-card.celebrate-message-card--right{
    display: none;
  }
}

@media screen and (min-width: 600px) and (max-width: 1024px) {
  .search-results__lists {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
  }
}

@media screen and (max-width: 599px) {

  .celebrate-body__notes p{
    text-align: left;
  }
  .tegami-wrap{
    padding: 0 10px;
  }
  .celebrate-hero {
    padding: 81px 0 40px;
     margin-bottom: -2px;

  }

  .tegami {
    border-radius: 20px 20px 0 0;
    padding: 32px 16px 40px;
    --tegami-pad-x: 18px;
    width: 100%;
  }

  .celebrate-hero__box {
    gap: 16px;
  }

  .celebrate-hero__top {
    width: 100%;
    padding: 20px 18px;
    margin-bottom: 0;
  }

  .celebrate-hero__eyebrow {
    font-size: 14px;
  }

  .celebrate-hero__title {
    font-size: 28px;
  }

  .celebrate-body__lead p{
    text-align: left;
  }

  .celebrate-hero__period {
    font-size: var(--font-size-xl);
  }

  .celebrate-hero__period--accent{
    font-size: var(--font-size-2xxl);
  }

  .celebrate-button {
    justify-content: center;
    width: 100%;
  }

  .celebrate-search-results {
    --message-card-gap: 24px;
    padding: 0 10px 40px;
  }

  .search-results__lists {
    grid-template-columns: 1fr;
    justify-content: center;
    justify-items: center;
    gap: 40px;
  }

  .search-results__lists > li {
    width: 100%;
  }
  .celebrate-search-results__inner{
    background-color: var(--celebrate-panel);
    width: 100%;
    margin-top: -48px;
    border-radius: 16px;
    box-shadow: 4px 4px 4px 0 rgba(0, 0, 0, 0.25);
    padding: 24px 16px 64px;
  }

  /* SP Decor (New Implementation) */
  .celebrate-hero__decor-sp {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: -40px 0 0;
  }
  .celebrate-hero__decor-sp img {
    height: auto;
    max-height: 120px;
    width: auto;
  }
  .celebrate-hero__decor-sp img:first-child {
    transform: translateX(-16px);
  }
    .celebrate-hero__decor-sp img:last-child {
    transform: translateX(16px);
  }

  .search-results__list .message-card {
    height: calc((100vw / 375) * 204);
  }
  .search-results__list  .message-card__text{
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  /* Previous styles removed as we now use .viewPc / .viewSp structure */

  .celebrate-hero__decor img{
    max-height: 104px;
  }

  .layer-front{
    z-index: 0;
  }
  .layer-back{
    height: 400px;
    bottom: 25%;
    z-index: 0;
    top: auto;
  }
  .celebrate-body__cta{
    width: 100%;
  }

}


/* ==========================================================================
   Search Form (Merged from common.css & customized for celebrate page)
   Match Design: Property 1 = Search bar (before expansion)
   ========================================================================== */

/* ↓↓↓ SP (max-width: 599px) ↓↓↓ */
@media screen and (max-width: 599px) {
    /* Container (Frame 76 parent + box) */
    .celebrate-search-results .search-form {
        box-sizing: border-box;
        position: relative;
        margin: 0 auto;
        background: #FFFFFF;
      
        border-radius: 8px 8px 0 0;
        min-height: 326px;
        display: flex;
        flex-direction: column;
        /* justify-content: center; */ /* Optional based on gap */
        gap: 24px;
        margin-bottom: 40px;
    }
    
    .celebrate-search-results .ajax-search-form {
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

     .celebrate-search-results .c-modal__panel{
        height:779px;
        padding: 0;
        box-shadow: none;
        background: transparent;
     }

    /* Top Area Layout */
    .celebrate-search-results .search-form__top {
       border: 1px solid #2E4580;
       border-radius: 8px 8px 0 0;
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 24px;
        padding: 32px 20px;
    }

    /* Reset Button & Advanced Search - Hidden on SP */
    .celebrate-search-results .search-form__reset,
    .celebrate-search-results .search-form__advanced {
        display: none !important;
    }
    
    /* Fields */
    .celebrate-search-results .search-form__field {
        width: 100%;
        flex: none;
    }

    /* Input & Select Common */
    .celebrate-search-results .search-form__input,
    .celebrate-search-results .search-form__select {
        box-sizing: border-box;
        width: 100%;
        height: 56px;
        background: #FFFFFF;
        border: 1px solid #D8DADC;
        border-radius: 5px;
        font-family: 'Zen Kaku Gothic New', sans-serif;
        font-size: 16px;
        color: #2E4580;
        padding: 8px 16px;
    }

    /* Keyword Specific */
    .celebrate-search-results .search-form__input--keyword {
        padding-left: 46px; /* 16px padding + 20px icon + 10px gap */
        background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z' stroke='%233F3F46' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: 16px center;
        background-size: 20px 20px;
    }
    .celebrate-search-results .search-form__input--keyword::placeholder {
        color: #949494;
        font-size: 14px;
    }

    /* Brand Specific */
    .celebrate-search-results .search-form__field--brand select {
        padding-right: 40px;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%232E4580' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        background-size: 11px 10px;
    }

    /* Submit Button (Small Size) */
    .celebrate-search-results .search-form__submit {
        position: relative;
        width: 100%;
        height: 54px; /* 54px logic: 47px face + 7px shadow space */
        margin-bottom: 7px;
        background: #D0EFF7;
        border: 2px solid #2E4580;
        border-radius: 30px;
        box-shadow: 0 7px 0 -2px #FFFFFF, 0 7px 0 0 #2E4580;
        color: #2E4580;
        font-family: 'Zen Kaku Gothic New', sans-serif;
        font-weight: 700;
        font-size: 16px;
        line-height: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        gap: 8px;
        cursor: pointer;
        transition: transform 0.1s;
    }
    .celebrate-search-results .search-form__submit::before {
        content: "";
        width: 16px;
        height: 16px;
        background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 14L11.1 11.1M12.6667 7.33333C12.6667 10.2789 10.2789 12.6667 7.33333 12.6667C4.38781 12.6667 2 10.2789 2 7.33333C2 4.38781 4.38781 2 7.33333 2C10.2789 2 12.6667 4.38781 12.6667 7.33333Z' stroke='%232E4580' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: contain;
    }
    .celebrate-search-results .search-form__submit:active {
        transform: translateY(7px);
        box-shadow: 0 0 0 -2px #FFFFFF, 0 0 0 0 #2E4580;
        margin-bottom: 0px;
    }

    /* Toggle Button */
    .celebrate-search-results .search-form__toggle {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 48px;
        background: #2E4580;
        border-radius: 0 0 7px 7px;
        border: none;
        color: #FFFFFF;
        font-family: 'Zen Kaku Gothic New', sans-serif;
        font-weight: 700;
        font-size: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        padding: 0;
    }
    .celebrate-search-results .search-form__toggle::after {
        content: "";
        width: 21px;
        height: 21px;
        /* SP版は asset5.svg を使用 */
        background-image: url("../images/celebratepage/asset5.svg");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        transition: transform 0.2s;
    }
    .celebrate-search-results .search-form[aria-expanded="true"] .search-form__toggle::after,
    .is-advanced-open .search-form__toggle::after {
        transform: rotate(180deg);
    }
}

/* ↓↓↓ 600px以上（PC・タブレット）のみ適用 ↓↓↓ */
@media screen and (min-width: 600px) {


  .celebrate-search-results__inner{
    background-color: var(--celebrate-panel);
    width: 100%;
    margin-top: -40px;
    border-radius: 0 0 28px 28px;
    box-shadow: 4px 4px 4px 0 rgba(0, 0, 0, 0.25);
    padding-top: 40px;
    
  }


/* Search Form Container */
/* Replaces previous .ajax-search-form styles */
.celebrate-search-results .ajax-search-form {
    padding: 0;
    box-shadow: none;
    background: transparent;
    max-width: 1520px; 
}

.celebrate-search-results .search-form {
    box-sizing: border-box;
    position: relative; /* Context for absolute toggle */
    width: 100%;
    max-width: 1232px;
    margin: 0 auto;
    background: #FFFFFF;
    border: 1px solid #2E4580;
    border-radius: 8px;
    padding-bottom: 48px; /* Space for the absolute positioned toggler */
    box-shadow: none; /* Reset overrides */
    
    /* Ensure content expansion works */
    min-height: 168px; /* Initial state */
    transition: none; /* Removed transition on height to avoid conflicts with JS slideDown */
    margin-bottom: 64px;
}

/* Form Top Area */
.celebrate-search-results .search-form__top {
    max-width: 1080px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 32px 20px 32px; /* Top 32px to input top (approx). Bottom padding to space out */
    gap: 40px;
    flex-wrap: wrap; 
    margin: auto;
}

/* Inputs and Selects Common */
.celebrate-search-results .search-form__field {
    flex: none; /* Disable flex grow/shrink from common styles */
}

.celebrate-search-results .search-form__input,
.celebrate-search-results .search-form__select {
    box-sizing: border-box;
    height: 56px;
    background: #FFFFFF;
    border: 1px solid #D8DADC;
    border-radius: 5px;
    padding: 8px 16px;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 16px;
    color: #2E4580;
    width: 100%;
}

.celebrate-search-results .search-form__input::placeholder {
    color: #949494;
    font-size: 14px;
}

/* Keyword Field */
.celebrate-search-results .search-form__field--keyword {
    width: 244px;
    position: relative;
}

.celebrate-search-results .search-form__input--keyword {
    width: 288px;
    padding-left: 44px; /* Space for icon */
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z' stroke='%233F3F46' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center; /* Left 16px */
    background-size: 20px 20px;
}

/* Brand Field */
.celebrate-search-results .search-form__field--brand {
    width: 266px;
    position: relative;
}

.celebrate-search-results .search-form__field--brand select {
    width: 266px;
    appearance: none;
    cursor: pointer;
    /* Chevron Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%232E4580' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 11px 10px;
    padding-right: 40px;
}

/* Reset Button */
.celebrate-search-results .search-form__reset {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #2E4580;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    /* width approx 86px */
}

.celebrate-search-results .search-form__reset:hover {
    text-decoration: underline;
}


.celebrate-body__notes {
  transform: translateY(0px);
}

/* Submit Button */
.celebrate-search-results .search-form__submit {
    position: relative;
    /* 0.95x of 221px -> 210px */
    width: 232px;
    height: 54px; /* Face height */
    margin-bottom: 7px; /* Space for shadow */
    
    background: #D0EFF7;
    border: 2px solid #2E4580;
    border-radius: 30px;
    
    /* Complex Shadow: White body with Blue border */
    /* Layer 1 (Top): White, shrunk by 2px (to show border underneath) */
    /* Layer 2 (Bottom): Blue, full size */
    box-shadow: 0 7px 0 -2px #FFFFFF, 0 7px 0 0 #2E4580;
    
    color: #2E4580;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, margin-top 0.1s, margin-bottom 0.1s;
    
    /* Icon via ::before */
    gap: 8px; /* Space between icon and text */
}

/* Icon */
.celebrate-search-results .search-form__submit::before {
    content: "";
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 14L11.1 11.1M12.6667 7.33333C12.6667 10.2789 10.2789 12.6667 7.33333 12.6667C4.38781 12.6667 2 10.2789 2 7.33333C2 4.38781 4.38781 2 7.33333 2C10.2789 2 12.6667 4.38781 12.6667 7.33333Z' stroke='%232E4580' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* Active State (Click) */
.celebrate-search-results .search-form__submit:active {
    transform: translateY(7px);
    box-shadow: 0 0 0 -2px #FFFFFF, 0 0 0 0 #2E4580; /* Shadow disappears/collapses */
    margin-bottom: 0px; /* Adjust flow if needed, but transform is better */
    /* If we transform, the element moves visually. The space remains. 
       If we want "Press down", transform is enough. 
       But we need to remove the shadow. */
}

/* Clean up old pseudo-elements if they were there implicitly in other blocks or overrides */
.celebrate-search-results .search-form__submit::after {
    content: none;
}


/* Toggle Button (Blue Bottom Bar) */
.celebrate-search-results .search-form__toggle {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 48px; /* 168px total - ~120px inputs */
    background: #2E4580;
    border-radius: 0 0 7px 7px; /* Match container 8px minus border */
    border: none;
    color: #FFFFFF;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.celebrate-search-results .search-form__toggle::after {
    content: "";
    width: 12px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s;
}

.celebrate-search-results .search-form[aria-expanded="true"] .search-form__toggle::after,
.is-advanced-open .search-form__toggle::after {
    transform: rotate(180deg);
}

/* Expanded State: Advanced Search Fields */
/* Note: Widths are scaled by approx 0.95x from Figma (1080px -> 1026px base) to match top bar inputs */

/* Advanced Search Area Container */
.celebrate-search-results .search-form__advanced {
    display: none; /* 初期状態は非表示 */
    
    /* Flex Layout Styles (Applied when shown via JS) */
    flex-direction: column;
    gap: 40px; /* Figma 40px * 0.95 */
    padding: 16px 24px 48px; 
    width: 100%;
    max-width: 1080px; /* Figma 1080px * 0.95 */
    margin: 0 auto;
    box-sizing: border-box;
}

/* Note: The display toggle logic is moved to JS (slideDown/Up) to support animation. 
   Basically, do not force display:flex in CSS for open state, let JS handle it. */

/* Responsive PC override */
@media screen and (min-width: 1025px) {
    .celebrate-search-results .search-form {
        /* Remove fixed height to allow natural expansion */
        min-height: 168px; /* Maintain visual integrity */
        height: auto; 
    }
    .celebrate-search-results.is-advanced-open .search-form {
         height: auto;
    }
}



/* Group Headers */
.celebrate-search-results .search-form__group-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid #2E4580;
    padding-left: 16px;
    height: 17px;
    margin-bottom: 12px;
}
.celebrate-search-results .search-form__group-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #2E4580;
    line-height: 1.7;
}
.celebrate-search-results .search-form__group-note {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 12px;
    color: #2E4580;
    line-height: 1.6;
}

/* Checkbox Groups */
.celebrate-search-results .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}
.celebrate-search-results .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-height: 44px;
    padding: 8px 0;
    font-family: 'Noto Sans JP', sans-serif; /* Per Figma */
    font-weight: 350; /* Light/Regular */
    font-size: 14.4px; /* Figma says 14.4px or 16px, let's go with 14.4px (approx 0.9rem) or 15px */
    color: #2E4580;
    line-height: 1;
}

/* Custom Checkbox Appearance */
.celebrate-search-results .checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #FFFFFF;
    border: 1px solid #D8DADC;
    border-radius: 2px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}

/* Checked State */
.celebrate-search-results .checkbox-group input[type="checkbox"]:checked {
    border-color: #2CA9E3;
}
.celebrate-search-results .checkbox-group input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 8px; top: 4px; /* Adjust for 24x24 center */
    width: 6px; height: 11px;
    border: solid #2CA9E3;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Note Text */
.celebrate-search-results .search-form__note {
    font-size: 12px;
    color: #2E4580;
    margin-top: 8px;
}


/* Row Layout for Prefecture & Year */
.celebrate-search-results .search-form__row {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap; /* 改行を許可 */
    gap: 24px 76px; /* Row gap 24px, Col gap 76px */
}
.celebrate-search-results .search-form__group--pref {
    width: 439px; /* 462px * 0.95 */
}
.celebrate-search-results .search-form__group--year {
    width: 418px; /* 440px * 0.95 */
}

/* Advanced Field Selects */
.celebrate-search-results .search-form__advanced select {
    width: 100%;
    height: 56px;
    background: #FFFFFF;
    border: 1px solid #D8DADC;
    border-radius: 5px;
    padding: 0 16px;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 16px;
    color: #2E4580;
    cursor: pointer;
    
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='10' viewBox='0 0 11 10' fill='none'%3E%3Cpath d='M0.5 0.5L5.5 5.5L10.5 0.5' stroke='%232E4580' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 11px 10px;
}
.celebrate-search-results .search-form__advanced select:invalid,
.celebrate-search-results .search-form__advanced select option[disabled] {
    color: #949494; /* Placeholder color? Figma says #2E4580 for placeholder '都道府県をお選びください' but usually placeholder is lighter. Let's keep 2E4580 if that's the design */
}

/* Year Range Layout */
.celebrate-search-results .search-form__range {
    display: flex;
    align-items: center;
    gap: 10px;
}
.celebrate-search-results .search-form__range select {
    width: 187px; /* 197px * 0.95 */
}
.celebrate-search-results .search-form__range-sep {
    font-size: 16px;
    color: #2E4580;
}

/* Currently Enrolled Checkbox (PC) */
.celebrate-search-results .search-form__currently-enrolled {
    margin-top: 12px;
}
.celebrate-search-results .search-form__currently-enrolled label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 350;
    font-size: 14.4px;
    color: #2E4580;
    line-height: 1;
}
.celebrate-search-results .search-form__currently-enrolled input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #FFFFFF;
    border: 1px solid #D8DADC;
    border-radius: 2px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}
.celebrate-search-results .search-form__currently-enrolled input[type="checkbox"]:checked {
    border-color: #2CA9E3;
}
.celebrate-search-results .search-form__currently-enrolled input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 4px;
    width: 6px;
    height: 11px;
    border: solid #2CA9E3;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Responsive PC override */
@media screen and (min-width: 1025px) {

   .celebrate-search-results__inner{
     background-color: var(--celebrate-panel);
     border-radius: 28px;
  box-shadow: 0 10px 0 var(--celebrate-shadow-soft);
  margin: -104px auto 0;
  width: 100%;
  padding: 80px 24px;
  max-width: 1440px;
  }


    .celebrate-search-results .search-form {
        /* Remove fixed height to allow natural expansion */
        /* height: 168px; */
        min-height: 168px; /* Maintain visual integrity */
        height: auto; 
    }
    .celebrate-search-results.is-advanced-open .search-form {
         /* Remove forced min-height to prevent jump */
         /* min-height: 688px; */
         height: auto;
    }
}

} /* End @media screen and (min-width: 600px) */




/* 
======================================
Tablet & SP Adjustment for Celebrate Hero
ファーストビューをSPと同じデザインに統一 (max-width: 1024pxまで適用)
======================================
*/
@media screen and (max-width: 1024px) {
  /* Override viewPc/viewSp visibility inside celebrate-hero */
  .celebrate-hero .viewPc {
    display: none !important;
  }
  .celebrate-hero .viewSp {
    display: block !important;
  }
  
  /* Make sure flex container behaves correctly */
  .celebrate-hero__decor-sp.viewSp {
    display: flex !important;
  }

  /* Ported SP Styles */
  .tegami-wrap{
    padding: 0 10px;
  }
  .celebrate-hero {
    padding: 81px 0 40px;
     margin-bottom: -2px;
  }

  .tegami {
    border-radius: 20px 20px 0 0;
    padding: 32px 16px 40px;
    --tegami-pad-x: 18px;
    width: 100%;
  }

  .celebrate-hero__box {
    gap: 16px;
    width: 100%;
  }

  .celebrate-hero__top {
    width: 100%;
    padding: 20px 18px;
    margin-bottom: 0;
  }

  .celebrate-hero__eyebrow {
    font-size: 14px;
  }

  .celebrate-hero__title {
    font-size: 28px;
  }

  .celebrate-body__lead p{
    text-align: left;
  }

  .celebrate-hero__period {
    font-size: var(--font-size-xl);
  }

  .celebrate-hero__period--accent{
    font-size: var(--font-size-2xxl);
  }

  .celebrate-button {
    justify-content: center;
    width: 100%;
  }

  /* SP Decor (New Implementation) */
  .celebrate-hero__decor-sp {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: -40px 0 0;
  }
  .celebrate-hero__decor-sp img {
    height: auto;
    max-height: 120px;
    width: auto;
  }
  .celebrate-hero__decor-sp img:first-child {
    transform: translateX(-16px);
  }
  .celebrate-hero__decor-sp img:last-child {
    transform: translateX(16px);
  }

  /* Reset PC/Tablet styles that might interfere */
  .celebrate-hero__decor img{
    max-height: 104px;
  }

  .layer-front{
    z-index: 0;
  }
  .layer-back{
    height: 400px;
    bottom: 25%;
    z-index: 0;
    top: auto;
  }
  .celebrate-body__cta{
    width: 100%;
  }
}

/* 
======================================
Tablet Adjustment for Search Results
検索結果エリアのタブレット調整 (600px - 1024px)
======================================
*/
@media screen and (min-width: 600px) and (max-width: 1024px) {
  .celebrate-search-results ,.tegami-wrap {
    padding-left: 25px;
    padding-right: 25px;
  }

  /* Search Form: SP版と同じレイアウト（縦並び・幅100%）に変更 */
  .celebrate-search-results .search-form__top {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 32px 24px;
  }

  /* ボタン内のレイアウト調整: 文字を中央、gapリセット */
  .celebrate-search-results .search-form__toggle {
    justify-content: center;
    gap: 0;
  }

  /* アイコン画像をタブレット版(asset6.svg)に差し替え & 絶対配置で右から100px */
  .celebrate-search-results .search-form__toggle::after {
    background-image: url("../images/celebratepage/asset6.svg");
    width: 53px;
    height: 21px;
    position: absolute;
    right: 100px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* 各フィールドと入力要素を幅100%に */
  .celebrate-search-results .search-form__field,
  .celebrate-search-results .search-form__field--keyword,
  .celebrate-search-results .search-form__input--keyword,
  .celebrate-search-results .search-form__submit {
    width: 100%;
    max-width: none;
  }

  /* Brandフィールドのみ調整 */
  .celebrate-search-results .search-form__field--brand,
  .celebrate-search-results .search-form__field--brand select {
    width: 100%;
    max-width: 280px;
    margin-right: auto; /* 左寄せ */
  }

  /* PC版で width指定されていたものを上書き */
  .celebrate-search-results .search-form__input--keyword {
    width: 100%;
  }

  /* クリアボタンを非表示 */
  .celebrate-search-results .search-form__reset {
    display: none;
  }

  /* ファーストビューの文字サイズをPC版に戻す */
  .celebrate-hero__eyebrow {
    font-size: 18px;
  }
  .celebrate-hero__title {
    font-size: var(--font-size-heading-l);
  }
  .celebrate-hero__period {
    font-size: var(--font-size-3xl);
  }
  .celebrate-hero__period--accent{
    font-size: var(--font-size-heading-m);
  }

  /* コンテンツ上下の画像の最大幅を150pxに */
  .celebrate-hero__decor-sp img {
    max-width: 150px;
    max-height: 150px;
  }
}