/* Copied from original wwwroot/css/site.css */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #4facfe;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  
  --bg-primary: #ffffff;
  /* 將次要背景改為淡紫色，維持文字可讀性 */
  --bg-secondary: #f5f3ff; /* subtle lavender */
  --bg-tertiary: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  margin: 0; padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.professional-header { background: var(--primary-gradient); box-shadow: var(--shadow-lg); position: sticky; top: 0; z-index: 1000; backdrop-filter: blur(10px); }
.professional-header .navbar { padding: 1rem 0; background: transparent !important; }

/* 動態漸層效果（頂端） */
.professional-header {
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 首頁 Hero 區塊微動態背景與文字效果 */
.hero-section {
  background: none;
  color: inherit;
  padding: 2.5rem 1rem;
}
.fade-in-up { animation: fadeUp .6s ease; }
/* 使封面在不同寬度下有合理高度，不固定 300px */
.hero-section {
  /* 高度以視窗寬度為基準，自動伸縮；手機約 180-220px，桌面約 320-380px */
  min-height: clamp(180px, 24vw, 380px);
  position: relative;
  width: 100%;
}
.hero-section .hero-content { position: relative; z-index: 2; }
/* 若曾有覆寫 .fade-in-up { height:300px; }，以下規則將其重置 */
.fade-in-up { height: auto; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.text-gradient { background: var(--secondary-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 五彩斜向文字漸層（首頁標語） */
.text-gradient-rainbow {
  background: linear-gradient(135deg, #ff6b6b, #f093fb, #6a11cb, #2575fc, #00c6ff, #00f2fe);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 8s ease infinite;
}

/* 類型圓形項目（主題相簿） */
.topic-chip-list { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.topic-chip { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.topic-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.topic-chip-thumb { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; color: var(--text-light); }
.topic-chip-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.topic-chip-title { font-weight: 600; color: var(--text-primary); }
.topic-chip { text-decoration: none; color: inherit; }

.card-img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 近似正方形 */
  overflow: hidden;
  border-top-left-radius: var(--border-radius-md);
  border-top-right-radius: var(--border-radius-md);
  background-color: var(--bg-tertiary);
}

.card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 填滿不留白 */
  object-position: center; /* 以照片中心為裁切基準 */
  display: block;
  transition: transform 0.3s ease;
}

/* --- Mobile Drawer for cover menu & hero full-width tweaks --- */
@media (max-width: 576px) {
  /* Hero: 取消左右內距，背景全寬呈現 */
  .hero-section { padding-left: 0; padding-right: 0; }
  .hero-section .hero-content { padding-left: 12px; padding-right: 12px; }

  /* Cover menu drawer */
  #coverMenu {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 65vh;
    overflow-y: auto;
    margin: 0;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    transform: translateY(100%);
    transition: transform .25s ease;
    z-index: 1050; /* above content */
  }
  #coverMenu.drawer-open { transform: translateY(0); }
}

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

.no-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  color: var(--text-light);
  font-size: 3rem;
}

/* Photo gallery sizing normalization */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.photo-gallery.six-cols {
  grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 1200px) {
  .photo-gallery.six-cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .photo-gallery.six-cols { grid-template-columns: repeat(2, 1fr); }
}
.photo-item { display: flex; flex-direction: column; }
.photo-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--border-radius-md);
  background: var(--bg-tertiary);
}
.photo-image { width: 100%; height: 100%; object-fit: cover; }

/* Calendar visual enhancements */
.calendar-table { table-layout: fixed; box-shadow: var(--shadow-md); border-radius: var(--border-radius-md); overflow: hidden; }
.calendar-table th, .calendar-table td { width: calc(100% / 7); }
.calendar-table td.has-events { background-color: #e6f4ff; cursor: pointer; }
.calendar-table td .calendar-cell { width: 100%; aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: space-between; padding: .5rem; }
.calendar-table .day-number { font-weight: 600; }

/* Albums index preview normalization */
.album-card .album-preview,
.card-img-container,
.topic-album-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* square cards */
  overflow: hidden;
  border-top-left-radius: var(--border-radius-md);
  border-top-right-radius: var(--border-radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.album-card .album-preview .card-img-top,
.card-img-container img,
.topic-album-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 填滿不留白 */
  object-position: center;
  display: block;
}
.album-card .placeholder-cover,
.no-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 封面管理面板標籤與單位寬度調整、上傳鈕字級縮小 */
#coverMenu .cover-label { min-width: 64px; white-space: nowrap; display: inline-block; }
#coverMenu .cover-unit { min-width: 72px; white-space: nowrap; display: inline-block; text-align: right; }
#coverMenu .cover-upload-btn { font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 576px) {
  #coverMenu .list-group-item form { flex-wrap: nowrap; }
}
/* 照片數顯示（移到圖片下方使用） */
.photo-count-below {
  margin-top: .5rem;
  display: inline-block;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  padding: .25rem .5rem;
  font-size: .85rem;
}

/* Albums Index 專用：直式不裁切、橫式裁切填滿 */
.albums-index .card-img-container img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: contain; /* 直式維持完整，不強制裁切 */
  object-position: center;
}
.albums-index .card-img-container img.is-landscape {
  object-fit: cover; /* 橫式裁切左右邊，填滿不留白 */
}
.card-img-container img {
    position:absolute;
    top:1%;
    left:1%;
    transform: translate(-1%,-1%);
    min-width: 100%;
    min-height: 100%;
    object-fit: fill;
}

/*.btn-outline-primary
{
    width:150px;
}
*/
.form-control-sm {
    font-size: 1rem;
}
.me-1 {
    font-size: 1rem;
}
.me-2 {
    font-size: 1rem;
}
.me-3 {
    font-size: 1rem;
}
.btn-lg {
    font-size: 1rem;
}
.btn-outline-secondary {
    font-size: 1rem;
}
h5 {
    font-size: 1rem;
}
.card-title {
    font-size: 1rem;
}
.badge {
    font-size: 0.8rem !important;
}

.al-1 {
    font-size: 1.2rem !important;
}

.jp-0 {
    width: 120px;
}

.al-0 {
    width: 80px;
}

.fade-in-up{
    height:300px;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-style: italic;
    font-weight: bolder;
}

/* 真的很小的手機可以再細調 */
@media (max-width: 576px) {
    .hero-subtitle {
        font-size: 1.2rem;
    }
}

.mb-3 {
    color: black !important;
}

/* 預設（手機優先）– 簡單、穩定、居中放大 */
.site-cover-bg {
    background-size: cover; /* 手機與各種怪比例畫面都保證不變形 */
    background-position: center; /* 不用 offset，預設居中 */
    background-repeat: no-repeat;
    filter: brightness(0.92);
    height: 55vh; /* 視窗高度比例，可再調 */
}

/* 中型以上螢幕（平板 / 桌機）才用你自訂的 offset + scale */
@media (min-width: 992px) {
    .site-cover-bg {
        height: 65vh; /* 桌機可稍微高一點 */
    }
}

.section-title {
    font-weight: bold;
}
.section-title2 {
    font-weight: bold;
    font-size: 1.8rem;
}

/* Like/Reaction overlay bottom-right on media frames */
.like-overlay,
.like-overlay-bottom-right {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  pointer-events: auto;
}
.like-overlay .like-btn,
.like-overlay-bottom-right .like-btn,
.album-like-btn.neutral-icon,
.photo-like-btn.neutral-icon,
.topic-like-btn.neutral-icon {
  background: none !important;
  border: none !important;
  outline: none !important;
  padding: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.like-overlay .like-count,
.like-overlay-bottom-right .like-count,
.album-like-count,
.photo-like-count,
.topic-like-count {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280; /* neutral gray, remove red styling */
}

/* Reaction picker pill */
.reaction-picker {
  display: none;
  position: absolute;
  right: 0;
  bottom: 28px;
  background: rgba(34, 34, 34, 0.95);
  color: #fff;
  border-radius: 18px;
  padding: 6px 10px;
  box-shadow: var(--shadow-md);
}
.reaction-picker .rx {
  background: none !important;
  border: none !important;
  outline: none !important;
  font-size: 16px;
  margin: 0 4px;
  padding: 0;
  cursor: pointer;
}

/* Stacked reaction icons (like + selected reaction) */
.reaction-stack {
  display: inline-flex;
  align-items: center;
}
.reaction-stack .icon {
  display: inline-block;
  margin-right: -2px; /* slight overlap */
}

/* Ensure media containers act as anchors */
.card-img-container,
.photo-container,
.album-info .position-relative {
  position: relative;
}

.mb-5 {
    margin-bottom: 0 !important;
}
/* 手機 */
@media (max-width: 576px) {
    .section-title {
        font-size: 1rem;
    }
    .section-title2 {
        font-size: 1.4rem;
    }
    .me-2 {
        font-size: 0.8rem;
    }
    .me-2a {
        font-size: 0.8rem;
    }
    .me-2b {
        font-size: 0.7rem;
    }
    .topic-chip-title {
        font-size: 0.9rem;
    }
    .in-1 {
        max-width: 140px;
    }
    .in-2 {
        max-width: 120px;
    }
    .navbar-toggler-icon {
        width: 1em;
        height: 1em;
    }
    .nav-link {
        font-size: 0.8rem;
    }
    .btn-outline-secondary {
        font-size: 0.8rem;
    }
    .btn-primary {
        font-size: 0.8rem
    }
    .btn-lg {
        font-size: 0.8rem;
    }
    .login-1 {
        margin-top: 10px;
    }
/*    .badge {
        display:none;
    }*/
}

/* 平板 */
@media (min-width: 577px) and (max-width: 768px) {
    .section-title {
        font-size: 1.4rem;
    }
    .in-1 {
        max-width: 220px;
    }
    .in-2 {
        max-width: 220px;
    }
    .login-1 {
        margin-top: 10px;
    }
/*    .badge {
        display: none;
    }*/
}

@media (min-width: 769px) and (max-width: 1024px) {
    .section-title {
        font-size: 1.8rem;
    }

    .in-1 {
        max-width: 220px;
    }

    .in-2 {
        max-width: 220px;
    }

/*    .badge {
        display: none;
    }*/
}

/* 桌機 */
@media (min-width: 1024px) {
    .section-title {
        font-size: 1.8rem;
    }

    .in-1 {
        max-width: 220px;
    }

    .in-2 {
        max-width: 220px;
    }
}
.album-like-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.album-like-bar .btn {
  padding: 2px 8px;
  line-height: 1;
}
.album-like-count {
  font-weight: 600;
}

/* Fixed footer styling */
.fixed-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
}