/* ===== CUSTOM PROPERTIES ===== */
:root {
  --bg: #0c0c0c;
  --surface: #161616;
  --surface2: #1e1e1e;
  --border: #272727;
  --gold: #c8a97e;
  --gold-dim: #7a6548;
  --rose: #9b6b7a;
  --text: #e8e0d8;
  --text-dim: #7a7068;
  --text-muted: #3e3a36;
  --radius: 8px;
  --header-h: 64px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Raleway', 'Shippori Mincho', serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .03em;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; width: 100%; height: auto; }
.hidden { display: none !important; }

/* ===== AGE GATE ===== */
#age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(200, 169, 126, 0.06) 0%, transparent 70%);
}

.gate-inner {
  text-align: center;
  max-width: 440px;
  width: 100%;
  animation: fadeUp 0.6s ease;
}

.gate-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 52px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 8px;
}

.gate-tagline {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.gate-divider {
  width: 40px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0 auto 28px;
}

.gate-warning {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 36px;
}

.gate-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-enter {
  background: var(--gold);
  color: #0c0c0c;
  padding: 14px 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  border-radius: 4px;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-enter:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-leave {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 10px;
  transition: color 0.2s;
}
.btn-leave:hover { color: var(--text-dim); }

.gate-legal {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Gate fade-out */
#age-gate.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  letter-spacing: 0.25em;
  color: var(--gold);
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  gap: 28px;
  flex: 1;
}

.header-nav a {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}
.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.25s ease;
}
.header-nav a:hover,
.header-nav a.active { color: var(--text); }
.header-nav a:hover::after,
.header-nav a.active::after { width: 100%; }

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface2);
}

/* ===== CATEGORY BAR ===== */
.category-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

.category-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.cat-tab {
  flex-shrink: 0;
  padding: 14px 20px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  position: relative;
  transition: color 0.2s;
}
.cat-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.25s ease;
}
.cat-tab:hover { color: var(--text); }
.cat-tab.active {
  color: var(--gold);
}
.cat-tab.active::after { width: calc(100% - 40px); }

/* ===== AD SLOTS ===== */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  position: relative;
}

.ad-label {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 2px;
}

.ad-banner {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 24px;
  height: 90px;
  background: var(--surface);
}

.ad-inline {
  margin: 40px auto;
  max-width: 728px;
  height: 90px;
  background: var(--surface);
}

/* ===== GALLERY ===== */
.gallery-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.masonry {
  columns: 4 240px;
  column-gap: 16px;
}

/* ===== CARDS ===== */
.card {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--surface);
}

.card:hover .card-overlay {
  opacity: 1;
}
.card:hover .card-img {
  transform: scale(1.04);
}

.card-img-wrap {
  overflow: hidden;
  position: relative;
}

.card-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: var(--surface2);
}

/* skeleton shimmer while loading */
.card-img:not([src]),
.card-img[src=""] {
  min-height: 200px;
  animation: shimmer 1.5s infinite;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.4;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-tag {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 20px;
}

.card-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  font-size: 14px;
}
.card:hover .card-fav { opacity: 1; }
.card-fav:hover { color: #e8758a; background: rgba(0,0,0,0.7); }
.card-fav.active { color: #e8758a; opacity: 1; }

/* Badges */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 3px;
}
.badge-new { background: var(--gold); color: #0c0c0c; }
.badge-hot { background: var(--rose); color: #fff; }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  letter-spacing: 0.25em;
  color: var(--gold-dim);
  margin-bottom: 24px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-bottom: 24px;
}
.footer-nav a {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--text-dim); }

/* ===== NEWS ===== */
.news-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.news-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  min-height: 44px;
}
.news-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--gold);
  border-right: 1px solid var(--border);
  padding-right: 20px;
  margin-right: 20px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px 0;
}
.news-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 12px;
}
.news-date {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.news-text { color: var(--text-dim); }

/* ===== 広告プレースホルダー共通 ===== */
.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: repeating-linear-gradient(
    45deg,
    var(--surface),
    var(--surface) 8px,
    var(--surface2) 8px,
    var(--surface2) 16px
  );
  border: 1px dashed var(--gold-dim);
  border-radius: 4px;
  opacity: .6;
}
.ad-placeholder-label {
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--gold);
  font-weight: 500;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 2px;
}
.ad-placeholder-size {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .06em;
}

/* 728x90 Sticky Bottom */
.ad-placeholder-728x90 {
  width: 100%;
  height: 90px;
}

/* Native Ad（ギャラリーカードと同サイズ）*/
.native-ad .card-img-wrap { cursor: default; }
.ad-placeholder-native {
  width: 100%;
  aspect-ratio: 4/5;
  min-height: 200px;
}

/* 300x600 サイドバー */
.ad-placeholder-300x600 {
  width: 300px;
  height: 600px;
}

/* ===== Sticky Bottom Banner ===== */
.ad-sticky-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-sticky-close {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: border-color .2s, color .2s;
}
.ad-sticky-close:hover { border-color: var(--gold); color: var(--gold); }

/* ===== Post Page Layout（コンテンツ + サイドバー）===== */
.post-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.post-layout .post-content {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}
.post-sidebar {
  flex-shrink: 0;
  width: 300px;
}
.post-sidebar-inner {
  position: sticky;
  top: 90px;
}

@media (max-width: 1100px) {
  .post-sidebar { display: none; }
  .post-layout  { padding: 0 24px 80px; }
}

.footer-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

@keyframes shimmer {
  0%   { background-color: var(--surface2); }
  50%  { background-color: var(--surface); }
  100% { background-color: var(--surface2); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .header-nav { display: none; }
  .masonry { columns: 3 180px; }
}
@media (max-width: 600px) {
  .masonry { columns: 2 140px; column-gap: 10px; }
  .card { margin-bottom: 10px; }
  .gallery-wrap { padding: 16px 12px; }
  .gate-logo { font-size: 40px; }
}
