/* 
 * 共通スタイルシート (assets/css/common.css)
 * 全ページ共通のCSS、およびTailwindで補えないカスタムレイアウト・アニメーション
 */

/* ==========================================================================
   Base (基底設定)
   ========================================================================== */
body {
    background-color: #FDFBF8;
    /* Washi-like off-white */
    color: #444444;
    -webkit-font-smoothing: antialiased;
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* スクロールバー非表示（横スクロールエリア等用） */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* ==========================================================================
   Animations (アニメーション)
   ========================================================================== */
/* フェードアニメーション（上下左右） */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-down {
    opacity: 0;
    transform: translateY(-40px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-down.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 画像ホバー時のズーム */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.6s ease;
}

.img-zoom:hover img {
    transform: scale(1.05);
}

/* 装飾アイコンの浮遊アニメーション */
.float-obj {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ==========================================================================
   Components (コンポーネント)
   ========================================================================== */
/* ハンバーガーメニューのライン */
.burger-line {
    width: 24px;
    height: 1px;
    background-color: #1a1816;
    display: block;
    transition: all 0.3s ease;
}

/* 左右スクロール領域のフェードマスク */
.tab-mask-container {
    position: relative;
    width: 100%;
}

.tab-mask-container::before,
.tab-mask-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.tab-mask-container::before {
    left: 0;
    background: linear-gradient(to right, #f9fafb, transparent);
}

.tab-mask-container::after {
    right: 0;
    background: linear-gradient(to left, #f9fafb, transparent);
}

.can-scroll-left::before {
    opacity: 1;
}

.can-scroll-right::after {
    opacity: 1;
}

#tab-header,
#tab-header-en {
    cursor: grab;
}

#tab-header:active,
#tab-header-en:active,
.is-dragging {
    cursor: grabbing;
}

.is-dragging button {
    pointer-events: none;
    user-select: none;
}

/* WordPressの標準エディタ・機能出力時のスタイル補正（必要に応じて） */
.no-data {
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

/* ==========================================================================
   Components - Buttons & Cards (FLOCSS / BEM)
   ========================================================================== */
/* 汎用カードボタン */
.c-card-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    text-decoration: none;
}

.c-card-btn:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.c-card-btn__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.c-card-btn:hover .c-card-btn__icon {
    background-color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Hanachozu Schedule Section (page-hanachozu.php)
   ========================================================================== */
.hanachozu-view-area {
    display: none;
}

/* 初期表示用 */
.hanachozu-view-area[data-view="list"] {
    display: block;
}

.hanachozu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hanachozu-item {
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    border-bottom: 1px dashed #e2e8f0;
    transition: background-color 0.3s ease;
}

@media (min-width: 768px) {
    .hanachozu-item {
        flex-direction: row;
        align-items: center;
        padding: 24px 10px;
    }
}

.hanachozu-item:hover {
    background-color: #8E76A905;
}

.hanachozu-item.is-ongoing {
    background-color: #8E76A908;
    border-left: 4px solid #8E76A9;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .hanachozu-item.is-ongoing {
        padding-left: 20px;
    }
}

.hanachozu-item__status {
    margin-bottom: 10px;
    min-width: 100px;
}

@media (min-width: 768px) {
    .hanachozu-item__status {
        margin-bottom: 0;
    }
}

.hanachozu-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.hanachozu-badge--ongoing {
    background-color: #8E76A9;
    color: white;
}

.hanachozu-badge--upcoming {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.hanachozu-item__date {
    font-weight: 800;
    color: #8E76A9;
    font-size: 13px; /* スマホでは少し小さめに */
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    min-width: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .hanachozu-item__date {
        margin-bottom: 0;
        font-size: 16px;
        min-width: 420px;
        margin-right: 30px;
    }
}

.hanachozu-item__name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    .hanachozu-item__name {
        font-size: 18px;
    }
}

.hanachozu-item__name a {
    color: inherit;
    transition: color 0.3s ease;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.hanachozu-item__name a:hover {
    color: #8E76A9;
    border-bottom-color: #8E76A9;
}

/* 過去の実施セクション */
.hanachozu-past-section {
    margin-top: 60px;
    background-color: #f8fafc;
    padding: 40px 20px;
    border-radius: 20px;
}

@media (min-width: 768px) {
    .hanachozu-past-section {
        padding: 60px 40px;
    }
}

.hanachozu-past-section__title {
    font-size: 18px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.hanachozu-past-section__title::before,
.hanachozu-past-section__title::after {
    content: '';
    height: 1px;
    background-color: #cbd5e1;
    width: 30px;
}

.hanachozu-list--past .hanachozu-item {
    opacity: 0.7;
    border-bottom-color: #cbd5e1;
}

.hanachozu-list--past .hanachozu-item__date {
    color: #64748b;
}

/* ==========================================================================
   Grid Calendar styles
   ========================================================================== */
.hanachozu-calendar-grid-container {
    padding: 10px 0;
}

.hanachozu-calendar-grid-container.is-single-month {
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .hanachozu-calendar-grid-container {
        padding: 40px;
    }
}

.hanachozu-month {
    width: 100%;
}

.hanachozu-month-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #8E76A9;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #8E76A915;
}

.calendar-nav-btn {
    appearance: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #8E76A9;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #8E76A910;
    transform: scale(1.1);
}

.calendar-nav-btn i {
    width: 24px;
    height: 24px;
}

.calendar-current-month {
    min-width: 150px;
    text-align: center;
}

.hanachozu-calendar-table {
    width: 100%;
}

.hanachozu-calendar-thead {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.hanachozu-calendar-th {
    padding: 10px 0;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}

.hanachozu-calendar-th:nth-child(6) {
    color: #3b82f6;
}

/* 土曜日 */
.hanachozu-calendar-th:nth-child(7) {
    color: #ef4444;
}

/* 日曜日 */

.hanachozu-calendar-tbody {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid #f1f5f9;
    border-left: 1px solid #f1f5f9;
}

.hanachozu-calendar-td {
    min-height: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 0;
    position: relative;
    font-size: 0.7rem;
    font-weight: 500;
    color: #475569;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.hanachozu-calendar-td.is-empty {
    background: #fcfcfd;
}

.hanachozu-calendar-td.is-today {
    background-color: #f1f5f9;
}

.hanachozu-calendar-td.is-today .day-number {
    color: #8E76A9;
    font-weight: 900;
}

.day-number {
    font-weight: 700;
    margin-bottom: 4px;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
}

.day-event-bar {
    display: block;
    width: 101%;
    margin-left: -0.5px;
    font-size: 8px;
    line-height: 1.2;
    padding: 3px 2px;
    min-height: 18px;
    /* 名称がなくても十分な厚みを確保 */
    background-color: #8E76A9;
    color: white;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-event-bar.is-continuation {
    padding: 3px 0;
}

.day-event-bar.is-start {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    margin-left: 2px;
    width: calc(100% - 2px);
}

.day-event-bar.is-end {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-right: 2px;
    width: calc(100% - 2px);
}

.day-event-bar a {
    color: inherit;
    text-decoration: none;
}

.day-event-bar.is-past {
    background-color: #cbd5e1;
    color: #64748b;
}

@media (min-width: 768px) {
    .hanachozu-calendar-td {
        min-height: 90px;
        font-size: 0.875rem;
        padding: 5px 0;
    }

    .day-event-bar {
        font-size: 10px;
        padding: 3px 4px;
    }
}