/* ========================================
   if(塾) Instagram風ブログ - スタイルシート v3.0
   デザイン：Instagram 2025 UI準拠
   ダークモード対応・モダンデザイン
   ======================================== */

/* CSS Variables - Instagram 2025 Design System */
:root {
  /* Instagram 2025 Dark Theme Colors */
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --bg-card: #1a1a1a;
  --bg-card-hover: #242424;

  /* Instagram Gradient Colors (Story Ring) */
  --ig-purple: #833ab4;
  --ig-red: #fd1d1d;
  --ig-orange: #fcb045;
  --ig-yellow: #f9ce34;
  --ig-pink: #ee2a7b;
  --ig-blue: #6228d7;

  /* Instagram UI Colors */
  --accent-blue: #0095f6; /* Instagram Blue */
  --accent-blue-light: #1aa1f7;
  --accent-purple: #833ab4;
  --accent-purple-light: #a855f7;
  --accent-gold: #fbbf24;
  --accent-green: #10b981;
  --accent-orange: #fcb045;

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #a8a8a8;
  --text-muted: #737373;

  /* Borders - Instagram Style */
  --border-color: #262626;
  --border-color-hover: #363636;

  /* Gradients */
  --gradient-instagram: linear-gradient(45deg, var(--ig-yellow), var(--ig-orange), var(--ig-red), var(--ig-pink), var(--ig-purple), var(--ig-blue));
  --gradient-story: linear-gradient(45deg, var(--ig-yellow), var(--ig-orange), var(--ig-red), var(--ig-pink), var(--ig-purple));
  --gradient-if-brand: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  --gradient-purple: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
  --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  --gradient-hero: linear-gradient(135deg, #121212 0%, #1a1a1a 50%, #121212 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
  --shadow-glow-blue: 0 0 40px rgba(0, 149, 246, 0.3);
  --shadow-glow-purple: 0 0 40px rgba(131, 58, 180, 0.3);
  --shadow-glow-instagram: 0 0 30px rgba(253, 29, 29, 0.2), 0 0 40px rgba(131, 58, 180, 0.2);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-round: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Layout */
  --max-width: 935px;
  --header-height: 70px;
  --story-size: 70px;
  --story-size-lg: 86px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========================================
   Header
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.header__logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

/* if塾ブランドグラデーションを維持 */
.header__logo span {
  background: var(--gradient-if-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   Main Container
   ======================================== */
.main {
  padding-top: calc(var(--header-height) + 24px);
  padding-bottom: 100px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ========================================
   Stories Section - Instagram 2025 Style
   ======================================== */
.stories {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 0 16px 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stories::-webkit-scrollbar {
  height: 4px;
}

.stories::-webkit-scrollbar-track {
  background: transparent;
}

.stories::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.stories__container {
  display: flex;
  gap: 20px;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.story-item:hover {
  transform: scale(1.05);
}

/* Instagram Rainbow Gradient Ring */
.story-item__ring {
  width: var(--story-size);
  height: var(--story-size);
  border-radius: var(--radius-round);
  padding: 3px;
  background: var(--gradient-story);
  box-shadow: var(--shadow-glow-instagram);
  position: relative;
}

/* Animated gradient effect on hover */
.story-item__ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-round);
  padding: 3px;
  background: var(--gradient-story);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  animation: rotate-gradient 3s linear infinite;
  transition: opacity var(--transition-fast);
}

.story-item:hover .story-item__ring::before {
  opacity: 1;
}

@keyframes rotate-gradient {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

.story-item__ring--viewed {
  background: linear-gradient(45deg, rgba(115, 115, 115, 0.5), rgba(115, 115, 115, 0.3));
  box-shadow: none;
}

.story-item__ring--highlight {
  background: linear-gradient(45deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
  box-shadow: none;
}

.story-item__avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-round);
  border: 3px solid var(--bg-primary);
  object-fit: cover;
  background: var(--bg-secondary);
}

.story-item__name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: var(--story-size);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* ========================================
   Highlights Section
   ======================================== */
.highlights {
  display: flex;
  gap: 28px;
  padding: 0 16px 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.highlights::-webkit-scrollbar {
  display: none;
}

.highlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.highlight-item__ring {
  width: var(--story-size-lg);
  height: var(--story-size-lg);
  border-radius: var(--radius-round);
  border: 2px solid var(--border-color);
  padding: 4px;
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
}

.highlight-item:hover .highlight-item__ring {
  transform: scale(1.08);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

.highlight-item__icon {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-round);
  object-fit: cover;
  background: var(--bg-card);
}

.highlight-item__name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========================================
   Posts Grid
   ======================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 16px;
}

@media (max-width: 600px) {
  .posts-grid {
    padding: 0;
    gap: 2px;
  }
}

.post-card {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.post-card:hover .post-card__image {
  transform: scale(1.05);
}

.post-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.6) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.post-card:hover .post-card__overlay {
  opacity: 1;
}

.post-card__type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ========================================
   Modal
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.modal__content {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  max-height: 90vh;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .modal__content {
    flex-direction: row;
    max-height: 85vh;
  }
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  color: white;
  font-size: 1.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-round);
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}

.modal__close:hover {
  background: var(--accent-blue);
  transform: scale(1.1);
}

/* Carousel */
.carousel {
  position: relative;
  flex: 1;
  min-height: 350px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .carousel {
    width: 60%;
    min-height: 550px;
  }
}

.carousel__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform var(--transition-normal);
}

.carousel__slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  color: var(--bg-primary);
  font-size: 1.1rem;
  font-weight: bold;
}

.carousel__nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-glow-blue);
}

.carousel__nav--prev {
  left: 16px;
}

.carousel__nav--next {
  right: 16px;
}

.carousel__nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel__dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.4);
  transition: all var(--transition-fast);
}

.carousel__dot.is-active {
  background: white;
  transform: scale(1.2);
}

/* Post Details */
.post-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
  background: var(--bg-secondary);
}

@media (min-width: 768px) {
  .post-details {
    width: 40%;
    max-width: 420px;
  }
}

.post-details__header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 14px;
}

.post-details__avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-round);
  background: var(--gradient-if-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
}

.post-details__username {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.post-details__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.post-details__caption {
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
}

.post-details__hashtags {
  margin-top: 20px;
  color: var(--accent-blue);
  font-size: 0.9rem;
}

.post-details__datetime {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-details__cta {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

/* Instagram Blue Button */
.post-details__cta-button {
  display: block;
  width: 100%;
  padding: 14px 28px;
  background: var(--accent-blue);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.post-details__cta-button:hover {
  background: var(--accent-blue-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-blue);
}

/* ========================================
   Story Viewer
   ======================================== */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg-primary);
  display: none;
}

.story-viewer.is-open {
  display: flex;
  flex-direction: column;
}

.story-viewer__header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.story-viewer__progress {
  display: flex;
  gap: 6px;
}

.story-viewer__progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}

.story-viewer__progress-fill {
  height: 100%;
  background: white;
  width: 0%;
  transition: width linear;
}

.story-viewer__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-viewer__user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.story-viewer__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  border: 2px solid white;
  background: var(--gradient-if-brand);
}

.story-viewer__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.story-viewer__time {
  font-size: 0.8rem;
  opacity: 0.7;
}

.story-viewer__close {
  color: white;
  font-size: 1.75rem;
  padding: 10px;
  transition: transform var(--transition-fast);
}

.story-viewer__close:hover {
  transform: scale(1.2);
}

.story-viewer__content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.story-viewer__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.story-viewer__text {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  text-align: center;
  padding: 0 20px;
  max-width: 90%;
}

.story-viewer__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  cursor: pointer;
}

.story-viewer__nav--prev {
  left: 0;
}

.story-viewer__nav--next {
  right: 0;
}

/* Instagram Blue Link Button */
.story-viewer__link {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: var(--accent-blue);
  padding: 14px 36px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow-blue);
}

.story-viewer__link:hover {
  background: var(--accent-blue-light);
  transform: translateX(-50%) translateY(-3px);
}

.story-viewer__link::after {
  content: "\2191";
  font-size: 1.1rem;
}

/* ========================================
   CTA Fixed Button - Instagram Blue
   ======================================== */
.cta-fixed {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  z-index: 50;
}

.cta-fixed__button {
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.cta-fixed__button:hover {
  transform: translateY(-3px);
}

.cta-fixed__button--primary {
  background: var(--accent-blue);
  color: white;
  box-shadow: var(--shadow-glow-blue);
}

.cta-fixed__button--primary:hover {
  background: var(--accent-blue-light);
  box-shadow: 0 0 60px rgba(0, 149, 246, 0.5);
}

.cta-fixed__button--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.cta-fixed__button--secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

/* ========================================
   Loading & Empty States
   ======================================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
}

.loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: var(--radius-round);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  text-align: center;
  padding: 60px 28px;
  color: var(--text-muted);
}

.empty__icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  opacity: 0.4;
}

/* ========================================
   Accessibility
   ======================================== */
.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;
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* ========================================
   Placeholder SVG Styles
   ======================================== */
.placeholder-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ========================================
   Service Cards - Instagram 2025 Style
   ======================================== */
.service-section {
  padding: 32px 16px;
  margin-bottom: 32px;
}

/* if塾ブランドグラデーションを維持 */
.service-section__title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  background: var(--gradient-if-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card--featured {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

.service-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-if-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.service-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.service-card__price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.service-card__price span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.service-card__description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.service-card__features {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.service-card__feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.service-card__feature::before {
  content: "✓";
  color: var(--accent-green);
  font-weight: 700;
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   Posts Controls - View Toggle & Category Filter
   ======================================== */
.posts-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

@media (min-width: 640px) {
  .posts-controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.posts-controls__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* View Toggle */
.view-toggle,
.view-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin: 0 16px 16px;
  width: fit-content;
}

.view-toggle__btn,
.view-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.view-toggle__btn:hover,
.view-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-card-hover);
}

.view-toggle__btn.is-active,
.view-tab.is-active,
.view-tab.view-tab--active {
  color: var(--text-primary);
  background: var(--accent-blue);
}

/* Posts Count */
.posts-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Category Filter */
.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 16px;
}

.category-filter::-webkit-scrollbar {
  height: 4px;
}

.category-filter::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.category-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.category-btn.is-active,
.category-btn.category-btn--active {
  color: white;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* ========================================
   Posts Grid Modes
   ======================================== */
.posts-grid--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.posts-grid--feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 500px;
  margin: 0 auto;
}

/* Feed Mode Post Card */
.post-card--feed {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  aspect-ratio: auto;
}

.post-card--feed:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
}

.post-card--feed .post-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.post-card--feed .post-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  background: var(--gradient-if-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.post-card--feed .post-card__meta {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card--feed .post-card__username {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.post-card--feed .post-card__date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-card--feed .post-card__category {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(0, 149, 246, 0.1);
  border-radius: var(--radius-sm);
}

.post-card--feed .post-card__media {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-secondary);
}

.post-card--feed .post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card--feed .post-card__type-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  color: white;
  font-size: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.post-card--feed .post-card__media-count {
  position: absolute;
  top: 12px;
  right: 40px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.post-card--feed .post-card__body {
  padding: 14px 16px;
}

.post-card--feed .post-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-card--feed .post-card__caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Multi-image badge for grid view */
.post-card__multi-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ========================================
   Posts Loading Indicator
   ======================================== */
.posts-loading,
.load-more {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.posts-loading.is-visible,
.load-more.is-visible {
  display: flex;
}

.posts-loading .loading__spinner,
.load-more .loading__spinner {
  width: 24px;
  height: 24px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --story-size: 62px;
    --story-size-lg: 76px;
  }

  .header__logo {
    font-size: 1.5rem;
  }

  .cta-fixed {
    bottom: 20px;
    gap: 10px;
  }

  .cta-fixed__button {
    padding: 12px 18px;
    font-size: 0.85rem;
  }

  .service-cards {
    grid-template-columns: 1fr;
  }

  /* Posts Controls Mobile */
  .posts-controls {
    padding: 12px;
    gap: 12px;
    margin: 0 12px 12px;
  }

  .posts-controls__left {
    justify-content: space-between;
    width: 100%;
  }

  .category-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .category-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Posts Grid Mobile */
  .posts-grid--grid {
    gap: 2px;
    padding: 0;
  }

  .posts-grid--feed {
    padding: 0 12px;
    max-width: 100%;
  }

  .post-card--feed .post-card__header {
    padding: 12px;
  }

  .post-card--feed .post-card__body {
    padding: 12px;
  }

  .posts-loading {
    padding: 24px;
  }
}
