
/* List */
.iwp-gazette-list-wrap{
  max-width: var(--iwp-gazette-maxw, 1530px);
  margin: 0 auto;
  padding: 10px;
}
.iwp-gazette-grid{
  display:grid;
  grid-template-columns: repeat(var(--iwp-gazette-cols, 4), minmax(0, 1fr));
  gap: 16px;
}
.iwp-gazette-card{
  display:block;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow:hidden;
  background:#fff;
  text-decoration:none !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
/* 리스트 썸네일: 세로 조금 더 길게 (3:4 비율 유지) */
.iwp-gazette-card-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 300px;
  background: #f3f4f6;
  background-size: cover;
  background-position: center;
}
.iwp-gazette-card-body{
  padding: 12px 14px;
}
.iwp-gazette-card-title{
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color:#111827;
  margin:0 0 6px 0;
  word-break: keep-all;
}
.iwp-gazette-card-date{
  font-size: 12px;
  color:#6b7280;
}

/* Pagination */
.iwp-gazette-pagination{
  margin-top: 18px;
}
.iwp-gazette-pagination ul{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  list-style:none;
  padding:0;
  margin:0;
}
.iwp-gazette-pagination a,
.iwp-gazette-pagination span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border:1px solid #e5e7eb;
  text-decoration:none;
  font-size: 14px;
}
.iwp-gazette-pagination .current{
  font-weight:700;
}

/* Responsive */
@media (max-width: 1024px){
  .iwp-gazette-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .iwp-gazette-grid{ grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

/* 리스트 페이지 내 뷰어 패널 (같은 페이지에서 리스트/뷰/수정) */
.iwp-gazette-viewer-panel {
  margin-top: 0;
  position: relative;
}
.iwp-gazette-viewer-panel-loading {
  padding: 40px;
  text-align: center;
  color: #64748b;
}
.iwp-gazette-viewer-panel .iwp-gazette-viewer {
  padding-top: 0;
}
/* 뷰페이지: 관보등록 버튼 우측 아래 */
.iwp-gazette-viewer-register-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
}
.iwp-gazette-viewer-register-wrap .iwp-gazette-open-register {
  padding: 10px 24px;
  font-size: 15px;
}

/* Single Viewer: 한 페이지 안 스크롤 + 헤더 유지 */
.iwp-gazette-viewer {
  max-width: 1800px;
  margin: 0 auto;
  padding: 16px 10px 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.iwp-gazette-viewer-header {
  flex-shrink: 0;
}
.iwp-gazette-viewer h1 {
  margin: 0 0 8px 0;
  font-size: 26px;
  line-height: 1.2;
}
.iwp-gazette-viewer-meta {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 16px;
}
/* 이미지 영역: 스크롤 없이 본문 흐름으로 쭉 내려서 보기 */
.iwp-gazette-viewer-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: visible;
}
.iwp-gazette-page {
  margin: 0 0 16px 0;
}
.iwp-gazette-page:last-child {
  margin-bottom: 0;
}
.iwp-gazette-page-num {
  display: none;
}
/* 썸네일(이미지) 세로 길이 줄임 */
.iwp-gazette-page img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  display: block;
}
/* 단일 페이지 하단: 리스트 / 수정 / 삭제 */
.iwp-gazette-viewer-actions {
  flex-shrink: 0;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.iwp-gazette-viewer-actions .iwp-gazette-btn {
  text-decoration: none;
}
.iwp-gazette-btn-danger {
  border-color: #dc2626;
  background: #fff;
  color: #dc2626;
}
.iwp-gazette-btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

/* ----- Shortcode page: 관보등록 (페이지 안 버튼 + 모달) ----- */
.iwp-gazette-has-register.iwp-gazette-list-wrap {
  position: relative;
}

/* 페이지 안 상단: 관보등록 버튼 */
/* 관보등록 버튼: 리스트 아래 우측 */
.iwp-gazette-list-header {
  margin-top: 20px;
  margin-bottom: 0;
  display: flex;
  justify-content: flex-end;
}
.iwp-gazette-list-header .iwp-gazette-open-register {
  padding: 10px 24px;
  font-size: 15px;
}

/* 빈 목록: 본문 안 메시지 + 관보등록 버튼 */
.iwp-gazette-empty {
  padding: 40px 24px;
  text-align: center;
}
.iwp-gazette-empty-text {
  margin: 0 0 16px 0;
  font-size: 15px;
  color: #475569;
  line-height: 1.6;
}
.iwp-gazette-empty-actions {
  margin: 0;
}
.iwp-gazette-empty-actions .iwp-gazette-open-register {
  padding: 12px 28px;
  font-size: 15px;
}

.iwp-gazette-ratio-3-4 {
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f1f5f9;
}

/* 모달만 body로 옮겨 레이아웃 영향 없이 표시 (z-index는 미디어 라이브러리 100100 아래로) */
#iwp-gazette-register-ui {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 99990;
}
#iwp-gazette-register-ui .iwp-gazette-modal {
  pointer-events: auto;
}

/* WordPress 미디어 창(100100)보다 낮게 해서 이미지 선택 시 미디어 창이 앞에 보이게 */
.iwp-gazette-modal {
  position: fixed;
  inset: 0;
  z-index: 99991;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.iwp-gazette-modal.is-open {
  opacity: 1;
  visibility: visible;
}

body.iwp-gazette-modal-open {
  overflow: hidden;
}

.iwp-gazette-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.iwp-gazette-modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.iwp-gazette-modal.is-open .iwp-gazette-modal-panel {
  transform: scale(1);
}

.iwp-gazette-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.iwp-gazette-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.iwp-gazette-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.iwp-gazette-modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.iwp-gazette-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.iwp-gazette-field-row {
  margin-bottom: 20px;
}

.iwp-gazette-field-row:last-child {
  margin-bottom: 0;
}

.iwp-gazette-field-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.iwp-gazette-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  box-sizing: border-box;
}

.iwp-gazette-input:focus {
  outline: none;
  border-color: #334155;
  box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.1);
}

.iwp-gazette-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.iwp-gazette-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.iwp-gazette-btn-primary {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  border-color: #334155;
  color: #fff;
}

.iwp-gazette-btn-primary:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  border-color: #475569;
  color: #fff;
}

.iwp-gazette-register-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.iwp-gazette-register-thumb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  min-height: 80px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.iwp-gazette-register-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
  cursor: move;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  aspect-ratio: 3 / 4;
}

.iwp-gazette-register-thumb:hover {
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.iwp-gazette-register-thumb-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.iwp-gazette-register-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

.iwp-gazette-register-thumb-remove:hover {
  background: #dc2626;
}

.iwp-gazette-description {
  font-size: 12px;
  color: #64748b;
  margin: 4px 0 10px 0;
}

.iwp-gazette-thumb-preview-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.iwp-gazette-thumb-preview {
  width: 72px;
  min-width: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 6px;
}

.iwp-gazette-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
