/**
 * ひよくま ピラーページ スタイル
 * .hiyokuma-pillar でスコープ
 * カレンダーとデザイン言語を統一（カラー・角丸・シャドウ）
 */

.hiyokuma-pillar {
  --hkp-accent: #F39C12;
  --hkp-color-event: #42A5F5;
  --hkp-color-gourmet: #FF7043;
  --hkp-color-oyako: #66BB6A;
  --hkp-color-spot: #AB47BC;
  --hkp-color-text: #37474F;
  --hkp-color-text-secondary: #78909C;
  --hkp-color-text-muted: #B0BEC5;
  --hkp-color-border: #ECEFF1;
  --hkp-color-bg: #FFFFFF;
  --hkp-color-bg-secondary: #F5F7FA;
  --hkp-radius-sm: 6px;
  --hkp-radius-md: 10px;
  --hkp-radius-lg: 16px;
  --hkp-radius-pill: 9999px;
  --hkp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --hkp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --hkp-transition: 0.2s ease;

  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--hkp-color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hiyokuma-pillar *,
.hiyokuma-pillar *::before,
.hiyokuma-pillar *::after {
  box-sizing: border-box;
}

/* ========================================
   Header
   ======================================== */
.hkp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.hkp-header__desc {
  font-size: 15px;
  color: var(--hkp-color-text-secondary);
  margin: 0;
  line-height: 1.8;
  flex: 1;
}

.hkp-header__count {
  font-size: 13px;
  color: var(--hkp-color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.hkp-header__count strong {
  font-size: 20px;
  color: var(--hkp-accent);
  font-weight: 700;
}

/* ========================================
   Calendar Link (events only)
   ======================================== */
.hkp-calendar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--hkp-color-event), #1E88E5);
  color: #fff;
  border-radius: var(--hkp-radius-md);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 24px;
  transition: all var(--hkp-transition);
  box-shadow: var(--hkp-shadow-sm);
}

.hkp-calendar-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--hkp-shadow-md);
  color: #fff;
}

.hkp-calendar-link__icon {
  font-size: 20px;
}

.hkp-calendar-link__arrow {
  margin-left: auto;
  font-size: 18px;
}

/* ========================================
   Filters
   ======================================== */
.hkp-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.hkp-filters::-webkit-scrollbar {
  display: none;
}

.hkp-area-btn {
  padding: 8px 18px;
  border: 2px solid var(--hkp-color-border);
  border-radius: var(--hkp-radius-pill);
  background: var(--hkp-color-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--hkp-color-text-secondary);
  cursor: pointer;
  transition: all var(--hkp-transition);
  white-space: nowrap;
  min-height: 44px;
  flex-shrink: 0;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.hkp-area-btn:hover {
  border-color: var(--hkp-color-text-muted);
  color: var(--hkp-color-text);
}

.hkp-area-btn:active {
  transform: scale(0.96);
}

.hkp-area-btn.is-active {
  background: var(--hkp-accent);
  color: #fff;
  border-color: var(--hkp-accent);
}

/* Filter count */
.hkp-filter-count {
  font-size: 13px;
  color: var(--hkp-color-text-muted);
  margin-bottom: 16px;
}

.hkp-filter-count__num {
  color: var(--hkp-accent);
  font-size: 16px;
}

/* ========================================
   Month Section
   ======================================== */
.hkp-month {
  margin-bottom: 40px;
}

.hkp-month__title {
  font-size: 18px;
  font-weight: 700;
  border-left: 4px solid var(--hkp-accent);
  padding-left: 12px;
  margin-bottom: 16px;
  color: var(--hkp-color-text);
}

/* ========================================
   Card Grid
   ======================================== */
.hkp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.hkp-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hkp-color-border);
  border-radius: var(--hkp-radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--hkp-color-text);
  background: var(--hkp-color-bg);
  transition: box-shadow var(--hkp-transition), transform var(--hkp-transition);
  box-shadow: var(--hkp-shadow-sm);
  animation: hkpCardIn 0.3s ease both;
}

.hkp-card:hover {
  box-shadow: var(--hkp-shadow-md);
  transform: translateY(-2px);
}

.hkp-card:active {
  transform: translateY(0);
  box-shadow: var(--hkp-shadow-sm);
}

.hkp-card--hidden {
  display: none !important;
}

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

/* ── Thumbnail ── */
.hkp-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--hkp-color-bg-secondary);
}

.hkp-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hkp-card:hover .hkp-card__thumb img {
  transform: scale(1.03);
}

/* Thumbnail fallback */
.hkp-card__thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--hkp-color-bg-secondary), var(--hkp-color-border));
  font-size: 36px;
  font-weight: 700;
  color: var(--hkp-color-text-muted);
}

/* ── Category Badge ── */
.hkp-card__cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: var(--hkp-radius-pill);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hkp-card__cat-badge--event   { background: var(--hkp-color-event); }
.hkp-card__cat-badge--gourmet { background: var(--hkp-color-gourmet); }
.hkp-card__cat-badge--oyako   { background: var(--hkp-color-oyako); }
.hkp-card__cat-badge--spot    { background: var(--hkp-color-spot); }

/* ── Card Body ── */
.hkp-card__body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hkp-card__date {
  font-size: 12px;
  color: var(--hkp-color-text-muted);
  margin-bottom: 4px;
}

/* Event-specific date styling */
.hkp-card__event-date {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--hkp-color-event);
  background: #E3F2FD;
  padding: 2px 8px;
  border-radius: var(--hkp-radius-sm);
  margin-bottom: 6px;
}

.hkp-card__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hkp-card__excerpt {
  font-size: 13px;
  color: var(--hkp-color-text-secondary);
  flex: 1;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hkp-card__place {
  font-size: 12px;
  color: var(--hkp-color-text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--hkp-color-border);
  display: flex;
  align-items: center;
  gap: 4px;
}

.hkp-card__place::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B0BEC5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* ========================================
   Empty / No Results
   ======================================== */
.hkp-empty {
  text-align: center;
  color: var(--hkp-color-text-muted);
  padding: 60px 20px;
  font-size: 15px;
}

.hkp-no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--hkp-color-text-muted);
}

.hkp-no-results p {
  font-size: 15px;
  margin-bottom: 16px;
}

.hkp-no-results__reset {
  padding: 8px 20px;
  border: 2px solid var(--hkp-accent);
  border-radius: var(--hkp-radius-pill);
  background: transparent;
  color: var(--hkp-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--hkp-transition);
  font-family: inherit;
}

.hkp-no-results__reset:hover {
  background: var(--hkp-accent);
  color: #fff;
}

/* ========================================
   Related Links
   ======================================== */
.hkp-related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--hkp-color-border);
}

.hkp-related__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  color: var(--hkp-color-text);
}

.hkp-related__links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hkp-related__link {
  --hkp-link-color: #F39C12;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid var(--hkp-color-border);
  border-radius: var(--hkp-radius-md);
  text-decoration: none;
  color: var(--hkp-color-text);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--hkp-transition);
  box-shadow: var(--hkp-shadow-sm);
}

.hkp-related__link:hover {
  border-color: var(--hkp-link-color);
  background: var(--hkp-color-bg-secondary);
  box-shadow: var(--hkp-shadow-md);
  transform: translateY(-1px);
}

.hkp-related__icon {
  font-size: 20px;
}

/* ========================================
   Responsive - Tablet
   ======================================== */
@media (max-width: 768px) {
  .hiyokuma-pillar {
    padding: 0 12px;
  }

  .hkp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hkp-cards {
    grid-template-columns: 1fr;
  }

  .hkp-card {
    flex-direction: row;
    height: auto;
  }

  .hkp-card__thumb {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 1 / 1;
  }

  .hkp-card__cat-badge {
    top: 6px;
    left: 6px;
    padding: 2px 7px;
    font-size: 10px;
  }

  .hkp-card__body {
    padding: 10px 14px;
  }

  .hkp-card__title {
    font-size: 14px;
  }

  .hkp-card__excerpt {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .hkp-related__links {
    flex-direction: column;
    align-items: stretch;
  }

  .hkp-related__link {
    justify-content: center;
  }

  .hkp-area-btn {
    padding: 6px 14px;
    font-size: 12px;
    min-height: 40px;
  }
}

/* ========================================
   Responsive - Mobile (480px)
   ======================================== */
@media (max-width: 480px) {
  .hkp-card__thumb {
    width: 100px;
    min-width: 100px;
  }

  .hkp-card__title {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .hkp-card__excerpt {
    display: none;
  }

  .hkp-calendar-link {
    font-size: 14px;
    padding: 12px 16px;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .hiyokuma-pillar {
    max-width: 100%;
    padding: 0;
  }

  .hkp-filters,
  .hkp-calendar-link {
    display: none !important;
  }

  .hkp-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
