/**
 * Study Abroad Bulletin Styles (Mobile)
 * 해외유학 게시판 전용 스타일 (모바일) - 새 디자인
 */

/* ========================================
   Variables
======================================== */
:root {
  --bd-primary: #b3322b;
  --bd-primary-hover: #912720;
  --bd-text-dark: #121316;
  --bd-text-secondary: #45484f;
  --bd-text-muted: #6b6e76;
  --bd-text-light: #9a9fa8;
  --bd-bg-page: #fafaf8;
  --bd-bg-dark: #121316;
  --bd-bg-fixed: #f6f3ef;
  --bd-bg-thead: #f0efea;
  --bd-border: #d9d9d4;
  --bd-border-light: #eceef3;
  --bd-cat-university: #3b4b75;
  --bd-cat-session: #b3322b;
  --bd-cat-faq: #45484f;
}

/* ========================================
   Base Layout
======================================== */
.bd-wrapper {
  font-family: Pretendard, 'Noto Sans KR', -apple-system, sans-serif;
  color: var(--bd-text-dark);
  background: var(--bd-bg-page);
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   Header - Dark Section
======================================== */
.bd-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bd-bg-dark);
  color: #fff;
  border-top: 1px solid #2a2d33;
}

.bd-header::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -2;
  background-image: var(--hero-photo);
  background-position: center;
  background-size: cover;
  filter: blur(14px);
}

.bd-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.72);
}

.bd-header__inner {
  padding: 48px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bd-header__breadcrumb {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--bd-text-light);
  text-decoration: none;
  transition: color 0.18s ease;
}

.bd-header__breadcrumb:hover {
  color: #fff;
}

.bd-header__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ef9c96;
}

.bd-header__title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.bd-header__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #c3cbe0;
}

/* ========================================
   Main Content
======================================== */
.bd-main {
  padding: 0 16px 80px;
}

/* ========================================
   Tabs Navigation
======================================== */
.bd-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--bd-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bd-tabs__item {
  flex-shrink: 0;
  height: 52px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--bd-text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.18s ease;
}

.bd-tabs__item:hover {
  color: var(--bd-text-dark);
}

.bd-tabs__item--active {
  font-weight: 700;
  color: var(--bd-text-dark);
  box-shadow: inset 0 -3px 0 var(--bd-primary);
}

/* ========================================
   Toolbar (Search)
======================================== */
.bd-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0 16px;
}

.bd-toolbar__count {
  margin: 0;
  font-size: 14px;
  color: var(--bd-text-secondary);
}

.bd-toolbar__count strong {
  color: var(--bd-primary);
}

.bd-search {
  display: flex;
  gap: 0;
  width: 100%;
}

.bd-search__select {
  border: 1px solid #d1d1cc;
  border-right: 0;
  padding: 0 8px;
  height: 44px;
  font-size: 14px;
  background: #fff;
  color: var(--bd-text-dark);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  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='%236b6e76' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 24px;
}

.bd-search__input {
  flex: 1;
  min-width: 0;
  border: 1px solid #d1d1cc;
  padding: 0 12px;
  height: 44px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
  outline: none;
}

.bd-search__input:focus {
  border-color: var(--bd-primary);
}

.bd-search__btn {
  width: 48px;
  height: 44px;
  border: 0;
  background: var(--bd-bg-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ========================================
   Table (Grid) - Mobile Optimized
======================================== */
.bd-table {
  border-top: 2px solid var(--bd-bg-dark);
}

/* Table Row - Mobile */
.bd-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--bd-border-light);
  color: var(--bd-text-dark);
  text-decoration: none;
}

.bd-row:active {
  background: #f5f5f3;
}

/* Fixed/Pinned Row */
.bd-row--fixed {
  background: var(--bd-bg-fixed);
}

.bd-row__num {
  display: none;
}

.bd-row__header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bd-row__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bd-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.bd-row__cat {
  font-size: 12px;
  font-weight: 600;
}

.bd-row__cat--university { color: var(--bd-cat-university); }
.bd-row__cat--session { color: var(--bd-cat-session); }
.bd-row__cat--faq { color: var(--bd-cat-faq); }

.bd-row__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.bd-row__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.bd-row--fixed .bd-row__title {
  font-weight: 700;
}

.bd-row__new {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bd-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.bd-row__file {
  flex-shrink: 0;
  color: var(--bd-text-muted);
  width: 14px;
  height: 14px;
}

.bd-row__date {
  font-size: 13px;
  color: var(--bd-text-muted);
}

.bd-row__views {
  display: none;
}

/* ========================================
   Pagination
======================================== */
.bd-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.bd-pagination__btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--bd-border);
  background: #fff;
  color: var(--bd-text-secondary);
  font-size: 14px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.bd-pagination__btn--active {
  border-color: var(--bd-text-dark);
  background: var(--bd-text-dark);
  color: #fff;
  font-weight: 700;
}

.bd-pagination__btn--disabled {
  color: var(--bd-text-muted);
}

/* ========================================
   Empty State
======================================== */
.bd-empty {
  padding: 60px 20px;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid var(--bd-border-light);
}

.bd-empty__icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.bd-empty__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--bd-text-dark);
  margin: 0 0 6px;
}

.bd-empty__desc {
  font-size: 14px;
  color: var(--bd-text-muted);
  margin: 0;
}

/* ========================================
   Detail Page
======================================== */
.bd-detail {
  padding: 24px 16px 80px;
}

/* Back Link */
.bd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bd-text-secondary);
  text-decoration: none;
}

.bd-back:hover {
  color: var(--bd-primary);
}

/* Article Header */
.bd-article__header {
  border-top: 2px solid var(--bd-text-dark);
  border-bottom: 1px solid var(--bd-border);
  padding: 24px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bd-article__meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bd-article__badge {
  background: var(--bd-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.bd-article__cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bd-primary);
}

.bd-article__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.bd-article__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--bd-text-muted);
}

.bd-article__info strong {
  color: var(--bd-text-secondary);
  font-weight: 600;
}

.bd-article__info-divider {
  display: none;
}

/* Content */
.bd-content {
  padding: 28px 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--bd-text-secondary);
}

.bd-content p {
  margin: 0 0 20px;
}

.bd-content p:last-child {
  margin-bottom: 0;
}

.bd-content img {
  max-width: 100%;
  height: auto;
}

/* Attachments */
.bd-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--bd-border);
}

.bd-files__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--bd-text-dark);
}

.bd-files__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--bd-border);
  font-size: 14px;
  color: var(--bd-text-secondary);
  text-decoration: none;
}

.bd-files__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-files__download {
  font-size: 12px;
  color: var(--bd-text-muted);
}

/* Adjacent (Prev/Next) */
.bd-adjacent {
  border-top: 2px solid var(--bd-text-dark);
  border-bottom: 1px solid var(--bd-border);
}

.bd-adjacent__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px 4px;
  border-bottom: 1px solid var(--bd-border-light);
  color: var(--bd-text-dark);
  text-decoration: none;
}

.bd-adjacent__item:last-child {
  border-bottom: 0;
}

.bd-adjacent__item:active {
  background: #f5f5f3;
}

.bd-adjacent__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bd-text-muted);
}

.bd-adjacent__title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-adjacent__date {
  display: none;
}

/* Actions */
.bd-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  margin-top: 32px;
}

.bd-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  border: 0;
}

.bd-btn--outline {
  border: 1.5px solid var(--bd-text-dark);
  background: transparent;
  color: var(--bd-text-dark);
}

.bd-btn--primary {
  background: var(--bd-primary);
  color: #fff;
}

/* ========================================
   Utilities
======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
