/* ==========================================================================
   2026 CALENDAR DOWNLOAD SITE - MINIMAL DESIGN SYSTEM
   - NO Drop Shadows (No box-shadow, no text-shadow, no drop-shadow filter)
   - NO Gradients (No linear-gradient, no radial-gradient)
   - Mobile-First Architecture
   ========================================================================== */

/* Design Tokens */
:root {
  /* Flat Solid Color Palette */
  --bg-page: #f7f7f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f0f0f2;
  --bg-active: #e4e4e7;
  
  --text-primary: #111111;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-inverse: #ffffff;
  
  --border-light: #e4e4e7;
  --border-medium: #d4d4d8;
  --border-dark: #18181b;

  --accent-black: #000000;
  --accent-white: #ffffff;

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius (Crisp & Minimal) */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --radius-phone: 32px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-page);
  line-height: 1.5;
}

/* Common Container for Mobile-First (Centered with max-width on tablet/desktop) */
.site-header,
.main-content,
.site-footer {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-surface);
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 1px;
}

.header-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: 1px solid var(--border-medium);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 0 0 var(--space-2xl) 0;
  flex: 1;
}

/* ==========================================================================
   Catalog View (トップページ：全員のカレンダー一覧)
   ========================================================================== */
.view-catalog {
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-xs);
}

.catalog-label-wrap {
  display: flex;
  flex-direction: column;
}

.catalog-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.catalog-count-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.catalog-lead {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-lg);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.catalog-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  user-select: none;
}

.catalog-card:hover {
  border-color: var(--border-dark);
}

.catalog-card:active {
  border-color: var(--accent-black);
}

.catalog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.catalog-card-no {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.catalog-card-tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-muted);
}

.catalog-card-frame {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  background-color: #141416;
  border-radius: 14px;
  padding: 6px;
  border: 1px solid #27272a;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-card-thumb {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.catalog-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 8px 0;
  background-color: var(--accent-black);
  color: var(--accent-white);
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 2px;
  transition: background-color 0.15s ease;
}

.catalog-card:hover .catalog-card-action {
  background-color: #27272a;
}

.catalog-card:active .catalog-card-action {
  background-color: #3f3f46;
}

/* ==========================================================================
   Detail View (個別ダウンロードビュー)
   ========================================================================== */
.view-detail {
  width: 100%;
}

.detail-nav-bar {
  position: sticky;
  top: 61px;
  z-index: 40;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 10px var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-back-to-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-back-to-list:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-dark);
}

.btn-back-to-list:active {
  background-color: var(--border-medium);
}

.detail-current-no {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

.detail-bottom-back {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.btn-bottom-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-bottom-back:hover {
  background-color: var(--border-medium);
}

.btn-bottom-back:active {
  background-color: var(--border-dark);
  color: var(--text-inverse);
}



/* ==========================================================================
   Preview Section (見本表示)
   ========================================================================== */
.preview-section {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-surface);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-md);
}

.preview-label-group {
  display: flex;
  flex-direction: column;
}

.label-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.preview-current-month {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-nav:hover {
  background-color: var(--border-medium);
}

.btn-nav:active {
  background-color: var(--border-dark);
  color: var(--text-inverse);
}

.month-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0 4px;
  color: var(--text-muted);
  min-width: 48px;
  text-align: center;
}

/* Smartphone Minimal Frame (Zero Drop-Shadow, Zero Gradient) */
.phone-frame-wrapper {
  display: flex;
  justify-content: center;
  margin: 0 auto var(--space-md);
  padding: 8px 0;
}

.phone-frame {
  width: 280px;
  max-width: 100%;
  padding: 10px;
  background-color: #1a1a1e;
  border: 1px solid #000000;
  border-radius: var(--radius-phone);
  position: relative;
}

/* Top Notch Indicator */
.phone-frame::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 4px;
  background-color: #2e2e33;
  border-radius: var(--radius-full);
  z-index: 10;
}

.phone-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  background-color: #0c0c0e;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #333338;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.wallpaper-sample {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.2s ease;
}

.btn-expand-preview {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background-color: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  pointer-events: auto;
}

/* Month Picker (Horizontal Pill Row) */
.month-picker-container {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 10px;
}

.month-picker-container::-webkit-scrollbar {
  display: none;
}

.month-picker {
  display: flex;
  gap: 6px;
  width: max-content;
}

.month-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 34px;
  padding: 0 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.month-pill:hover {
  border-color: var(--border-dark);
  color: var(--text-primary);
}

.month-pill.active {
  background-color: var(--accent-black);
  border-color: var(--accent-black);
  color: var(--accent-white);
}

.preview-caption {
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   Downloads Section
   ========================================================================== */
.downloads-section {
  padding: var(--space-xl) var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.section-title-wrap {
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 2px;
}

.action-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.action-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.action-card-primary {
  border-color: var(--border-dark);
  background-color: var(--bg-surface);
}

.card-header-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.card-filesize {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
}

.card-headline {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.card-subtext {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Action Buttons (Solid / Outline, No Shadows) */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-solid {
  background-color: var(--accent-black);
  border: 1px solid var(--accent-black);
  color: var(--accent-white);
}

.btn-solid:hover {
  background-color: #27272a;
  border-color: #27272a;
}

.btn-solid:active {
  background-color: #3f3f46;
}

.btn-outline {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
}

.btn-outline:active {
  background-color: var(--border-medium);
}

/* Monthly Wallpapers Modal Specifics */
.monthly-modal-dialog {
  max-width: 440px;
  width: 92%;
  max-height: 85vh;
}

.monthly-modal-body {
  background-color: var(--bg-page);
  padding: var(--space-md);
  overflow-y: auto;
  display: block;
  text-align: left;
}

.modal-guide {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Wallpapers Grid (12 Items) */
.wallpapers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.wallpaper-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallpaper-thumb-wrap {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  background-color: #141416;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.wallpaper-thumb {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.wallpaper-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.wallpaper-month-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.wallpaper-month-jp {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.btn-card-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-download:active {
  background-color: var(--accent-black);
  color: var(--accent-white);
  border-color: var(--accent-black);
}

/* ==========================================================================
   Guide Section
   ========================================================================== */
.guide-section {
  padding: var(--space-lg) var(--space-md);
}

.guide-box {
  background-color: var(--bg-page);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.guide-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-item {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-platform {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  padding: var(--space-xl) var(--space-md) calc(var(--space-xl) + env(safe-area-inset-bottom));
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-license {
  font-size: 0.6875rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.4;
  margin-top: 4px;
}

.footer-bottom {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modal Components (Preview & QR)
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
}

.modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
}

.modal-dialog {
  position: relative;
  z-index: 101;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--space-md);
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-surface);
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-md);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #000000;
}

.modal-img-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.modal-img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.modal-footer {
  padding: var(--space-md);
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-hint {
  font-size: 0.6875rem;
  text-align: center;
  color: var(--text-muted);
}

/* QR Modal Specifics */
.qr-modal-dialog {
  max-width: 360px;
}

.qr-modal-body {
  background-color: var(--bg-surface);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.qr-target-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.qr-canvas-wrap {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-md);
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-canvas-wrap svg,
.qr-canvas-wrap img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-instruction {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: var(--space-md);
}

.qr-url-box {
  display: flex;
  gap: 6px;
  width: 100%;
}

.qr-url-input {
  flex: 1;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.btn-copy-url {
  padding: 8px 12px;
  background-color: var(--accent-black);
  border: 1px solid var(--accent-black);
  color: var(--accent-white);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy-url:active {
  background-color: #333333;
}
