/*
Theme Name: HEXY
Theme URI:  https://hexy.social
Author:     HEXY Dev Team
Version:    0.1.15
Description: Invite-only microblog theme for HEXY (水溜まりローディング対応)
Requires at least: 6.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hexy
*/

/* =============================================================================
   HEXY Theme – Custom Front-End Styles
   --------------------------------------------------------------------------- */

/* ---------- 1. CSS変数（カラーパレット） ----------------------------- */
:root {
  --hexy-grad-from: #19e1ff;
  --hexy-grad-to: #e448ff;
  --hexy-primary: #3ac8ff;
  --hexy-primary-dark: #b42cff;
  --hexy-accent: #5a6dff;
  --hexy-bg: #050712;
  --hexy-card-bg: rgba(255,255,255,.03);
  --hexy-card-brd: #20243a;
  --hexy-text: #f3f4f6;
  --hexy-muted: #9ca3af;
}

@media (prefers-color-scheme: light) {
  :root {
    --hexy-bg: #fff;
    --hexy-card-bg: #fdfdfd;
    --hexy-card-brd: #e5e7eb;
    --hexy-text: #111827;
    --hexy-muted: #64748b;
  }
}

/* ---------- 2. ベーススタイル -------------------------------------- */
body {
  background: var(--hexy-bg);
  color: var(--hexy-text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.6;
  margin: 0;
  overflow-x: hidden;
  width: 100%;
}

html {
  overflow-x: hidden;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--hexy-card-brd);
  border-radius: 4px;
}

/* リンク */
a {
  color: var(--hexy-primary);
  text-decoration: none;
}

a:hover {
  color: var(--hexy-primary-dark);
}

/* ---------- 3. レイアウトコンテナ ---------------------------------- */
.hexy-container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(12px, 2vw, 24px);
  box-sizing: border-box;
}

/* 固定ページでも同じ幅を維持 */
body.page .hexy-container,
body.page .site-main {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(12px, 2vw, 24px);
  box-sizing: border-box;
}

/* ---------- 4. ヘッダー -------------------------------------------- */
.site-header {
  background: var(--hexy-card-bg);
  border-bottom: 1px solid var(--hexy-card-brd);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
  width: 100%;
  box-sizing: border-box;
}

/* サイトブランディング */
.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  flex-shrink: 0;
}

.site-branding .logo,
.site-branding figure,
.site-branding .wp-block-image {
  margin: 0;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 36px;
}

.site-branding img.logo,
.site-branding figure img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hexy-text);
  margin: 0;
  padding: 0;
  line-height: 36px;
  height: 36px;
  display: flex;
  align-items: center;
}

.site-title a {
  color: #ffffff;
  text-decoration: none;
  display: inline-block;
  line-height: inherit;
}

.site-title a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ヘッダー下のスペース */
.site-header + * {
  margin-top: 2rem;
}

/* ---------- 5. ナビゲーション -------------------------------------- */
.primary-nav,
.desktop-nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.primary-nav ul,
.desktop-nav ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.primary-nav li,
.desktop-nav li {
  margin: 0;
  padding: 0;
  display: inline-block;
}

.primary-nav a,
.desktop-nav a {
  color: var(--hexy-muted);
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}

.primary-nav a:hover,
.desktop-nav a:hover,
.primary-nav a[aria-current="page"],
.desktop-nav a[aria-current="page"] {
  color: var(--hexy-primary);
}

/* 固定ページでも同じスタイルを適用 */
body.page .desktop-nav {
  display: flex !important;
}

body.page .desktop-nav > ul {
  display: flex !important;
  flex-direction: row !important;
  gap: 1.25rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------- 6. モバイルメニュー ------------------------------------ */
@media (min-width: 641px) {
  .mobile-menu-toggle,
  .mobile-menu-overlay {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .desktop-nav {
    display: none !important;
  }
  
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
    margin-left: auto;
    flex-shrink: 0;
  }
  
  .mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--hexy-text);
    border-radius: 3px;
    transition: all 0.3s;
  }
  
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
  }
  
  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  .mobile-menu {
    position: absolute;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--hexy-bg);
    padding: 60px 20px 20px;
    transition: right 0.3s ease-out;
    overflow-y: auto;
  }
  
  .mobile-menu-overlay.active .mobile-menu {
    right: 0;
  }
  
  .mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--hexy-text);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
  }
  
  .mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .mobile-menu li {
    border-bottom: 1px solid var(--hexy-card-brd);
  }
  
  .mobile-menu a {
    display: block;
    padding: 15px 0;
    color: var(--hexy-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s;
  }
  
  .mobile-menu a:hover {
    color: var(--hexy-primary);
  }
  
  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* モバイルメニューのユーザー情報 */
.mobile-menu-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--hexy-card-brd);
}

.mobile-menu-user img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-menu-user-info {
  display: flex;
  flex-direction: column;
}

.mobile-menu-user-info strong {
  color: var(--hexy-text);
  font-size: 16px;
  margin-bottom: 4px;
}

.mobile-menu-user-info span {
  color: var(--hexy-muted);
  font-size: 14px;
}

.menu-divider {
  height: 1px;
  background: var(--hexy-card-brd);
  margin: 10px 0;
  list-style: none;
}

.notification-badge {
  display: inline-block;
  background: var(--hexy-primary);
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: bold;
}

/* ---------- 7. タイムラインカード ---------------------------------- */
#hexy-timeline {
  list-style: none;
  margin: 2rem 0 0 0;
  padding: 0;
}

.hexy-card {
  background: var(--hexy-card-bg);
  border: 1px solid var(--hexy-card-brd);
  border-radius: .75rem;
  padding: 1.25rem;
  overflow: hidden;
  backdrop-filter: blur(6px);
  transition: border-color .25s, transform .25s;
}

.hexy-card:hover {
  border-color: var(--hexy-primary);
  transform: translateY(-2px);
}

.hexy-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
  margin-bottom: .5rem;
  color: var(--hexy-muted);
}

.hexy-card__author {
  font-weight: 600;
  color: var(--hexy-text);
}

.hexy-card__content {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.hexy-card > figure {
  margin: 0;
}

.hexy-card > figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .5rem;
}

a.hexy-card-link {
  color: var(--hexy-text);
  text-decoration: none;
}

a.hexy-card-link:hover {
  color: var(--hexy-text);
}

/* タイムラインフッター */
.hexy-timeline-footer {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.hexy-timeline-footer-content {
  background: var(--hexy-card-bg);
  border: 1px solid var(--hexy-card-brd);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  text-align: center;
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
}

.hexy-timeline-footer-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hexy-grad-from), var(--hexy-grad-to));
}

.hexy-timeline-footer-logo {
  margin-bottom: 1.5rem;
}

.hexy-logo-gradient {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--hexy-grad-from), var(--hexy-grad-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  letter-spacing: 0.05em;
}

.hexy-timeline-footer-text {
  margin-bottom: 2rem;
}

.hexy-timeline-footer-text p {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  color: var(--hexy-text);
  font-weight: 500;
}

.hexy-timeline-footer-subtitle {
  font-size: 0.9375rem !important;
  color: var(--hexy-muted) !important;
  font-weight: 400 !important;
}

.hexy-timeline-footer-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.hexy-timeline-footer-btn {
  background: linear-gradient(135deg, var(--hexy-grad-from), var(--hexy-grad-to));
  color: #fff;
  border: 0;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(25, 225, 255, 0.2);
}

.hexy-timeline-footer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(25, 225, 255, 0.3);
  opacity: 0.9;
}

/* ---------- 8. 画像グリッド ---------------------------------------- */
body .hexy-image-grid {
  display: grid !important;
  gap: 8px !important;
  margin: 0 0 1rem !important;
  grid-auto-rows: 1fr !important;
  grid-template-columns: repeat(2, 1fr) !important;
}

/* JavaScript により動的に付与されるクラス制御 */
body .hexy-image-grid.img-count-1 {
  grid-template-columns: 1fr !important;
}

body .hexy-image-grid.img-count-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

body .hexy-image-grid.img-count-3 {
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: 1fr 1fr !important;
}

body .hexy-image-grid.img-count-3 figure:nth-child(3) {
  grid-column: 1 / 2 !important;
  grid-row: 2 / 3 !important;
}

body .hexy-image-grid.img-count-4 {
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
}

/* 画像の共通スタイル */
body .hexy-image-grid figure {
  position: relative !important;
  margin: 0 !important;
  padding-top: 100% !important;
  overflow: hidden !important;
}

body .hexy-image-grid img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 8px !important;
}

/* ---------- 9. ライトボックス -------------------------------------- */
#hexy-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .8);
  z-index: 50;
}

#hexy-lightbox.hidden {
  display: none;
}

#hexy-lightbox img {
  max-width: 100%;
  max-height: 100%;
}

/* ---------- 10. 投稿フォーム（水溜まりローディング対応版） ----------- */
#hexy-post-form {
  margin-top: 2rem;
}

#hexy-post-form textarea {
  background: var(--hexy-card-bg);
  border: 1px solid var(--hexy-card-brd);
  border-radius: .75rem;
  width: 100%;
  color: var(--hexy-text);
  resize: vertical;
  padding: .75rem 1rem;
  line-height: 1.5;
  transition: border-color .2s;
  font-size: 16px !important;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

#hexy-post-form textarea:focus {
  outline: 0;
  border-color: var(--hexy-primary);
}

/* 投稿フォームのアクションエリア */
.hexy-post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hexy-post-actions-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.hexy-post-actions-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 画像選択ボタン */
.hexy-image-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--hexy-card-bg);
  border: 1px solid var(--hexy-card-brd);
  border-radius: 50%;
  color: var(--hexy-primary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-size: 18px;
}

.hexy-image-btn:hover {
  background: var(--hexy-primary);
  color: #fff;
  transform: translateY(-1px);
}

.hexy-image-btn input[type="file"] {
  display: none;
}

/* 追加のアクションボタン */
.hexy-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--hexy-card-brd);
  border-radius: 50%;
  color: var(--hexy-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

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

/* ポストボタン（水溜まりローディング対応） */
.hexy-post-btn {
  position: relative;
  background-image: linear-gradient(135deg, var(--hexy-grad-from), var(--hexy-grad-to));
  color: #fff;
  border: 0;
  border-radius: 9999px;
  padding: .65rem 2rem;
  font-weight: 600;
  font-size: .9375rem;
  cursor: pointer;
  min-width: 100px;
  overflow: hidden;
  transition: opacity .2s, transform .2s;
  z-index: 1;
}

.hexy-post-btn:hover:not(.loading) {
  opacity: .9;
  transform: translateY(-1px);
}

.hexy-post-btn:disabled {
  cursor: not-allowed;
}

/* 水のベース（通常時は見えない） */
.hexy-post-btn::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(25, 225, 255, 0.8), 
    rgba(228, 72, 255, 0.8)
  );
  transition: top 0.1s ease-out;
  z-index: -1;
}

/* 水面の波エフェクト */
.hexy-post-btn::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -100%;
  width: 200%;
  height: 20px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3) 25%, 
    rgba(255, 255, 255, 0.5) 50%, 
    rgba(255, 255, 255, 0.3) 75%, 
    transparent
  );
  border-radius: 50%;
  z-index: 0;
  opacity: 0;
}

/* ローディング状態のアニメーション */
.hexy-post-btn.loading::before {
  animation: hexy-water-fill 3s ease-in-out forwards;
}

.hexy-post-btn.loading::after {
  animation: hexy-water-wave 3s ease-in-out forwards, 
             hexy-wave-move 1.5s linear infinite;
}

.hexy-post-btn.loading {
  animation: hexy-subtle-glow 2s ease-in-out infinite alternate;
  transform: none;
}

/* ローディング中のテキスト */
.hexy-post-btn .btn-text {
  position: relative;
  z-index: 2;
  transition: opacity 0.3s;
}

.hexy-post-btn.loading .btn-text {
  opacity: 0.9;
}

/* ステータス表示 */
#hexy-status {
  font-size: .875rem;
  color: var(--hexy-muted);
  margin-right: auto;
}

/* 文字数カウンター */
.hexy-char-counter {
  font-size: 0.75rem;
  color: var(--hexy-muted);
  text-align: right;
  margin-top: 0.25rem;
}

.hexy-char-counter.warning {
  color: #fbbf24;
}

.hexy-char-counter.error {
  color: #ef4444;
}

/* ---------- 11. 画像プレビュー ------------------------------------- */
.hexy-image-preview {
  display: none;
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
  flex-wrap: wrap;
  padding: 0;
}

.hexy-image-preview:not(:empty) {
  display: flex !important;
}

.hexy-image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--hexy-card-bg);
  border: 2px solid var(--hexy-card-brd);
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  animation: fadeInScale 0.3s ease-out;
}

.hexy-image-preview-item:hover {
  transform: scale(1.05);
  border-color: var(--hexy-primary);
}

.hexy-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.hexy-image-preview-item:hover img {
  opacity: 0.8;
}

.hexy-image-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #ef4444;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hexy-image-preview-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* ---------- 12. リンクプレビューカード ----------------------------- */
.hexy-linkcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--hexy-card-bg);
  border: 1px solid var(--hexy-card-brd);
  border-radius: .75rem;
  transition: border-color .2s, background .2s, transform .2s;
}

.hexy-linkcard:hover {
  border-color: var(--hexy-primary);
  background: rgba(255, 255, 255, .02);
  transform: translateY(-1px);
}

.hexy-linkcard * {
  text-decoration: none;
  color: inherit;
}

.hexy-linkcard__thumb {
  flex: 0 0 160px;
  background-size: cover;
  background-position: center;
}

.hexy-linkcard__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hexy-linkcard__host {
  font-size: .75rem;
  color: var(--hexy-muted);
}

.hexy-linkcard__title {
  font-weight: 600;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hexy-linkcard__desc {
  font-size: .875rem;
  color: var(--hexy-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

@media (min-width: 640px) {
  .hexy-linkcard {
    flex-direction: row;
  }
  .hexy-linkcard__thumb {
    height: 100%;
  }
}

/* ---------- 13. 投稿者情報 ----------------------------------------- */
.hexy-author {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.hexy-author__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.hexy-author__name {
  font-weight: 600;
  color: var(--hexy-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hexy-author__handle {
  white-space: nowrap;
}

.hexy-author__badge {
  width: 16px;
  height: 16px;
  flex: none;
  background: url('data:image/svg+xml;utf8,\
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffffff">\
  <path d="M22.46 12.29l-2.1-1.21.61-2.32a1 1 0 00-1.48-1.12l-2 1.24-1.24-2\
  a1 1 0 00-1.73 0l-1.21 2.1-2.32-.61a1 1 0 00-1.12 1.48l1.24 2-2 1.24a1 1 0 000 1.73l2.1 1.21-.61 2.32a1 1 0 001.48 1.12l2-1.24 1.24 2a1 1 0 001.73 0l1.21-2.1 2.32.61a1 1 0 001.12-1.48l-1.24-2 2-1.24a1 1 0 000-1.73z"/>\
  <path d="M10.6 13.79l-1.3-1.3a.75.75 0 011.06-1.06l.77.77 2.68-2.68a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0z"/>\
  </svg>') center/contain no-repeat;
}

.hexy-date {
  white-space: nowrap;
}

/* ---------- 14. 固定ページスタイル --------------------------------- */
.hexy-page {
  background: var(--hexy-card-bg);
  border: 1px solid var(--hexy-card-brd);
  border-radius: .75rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--hexy-card-brd);
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, var(--hexy-grad-from), var(--hexy-grad-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-excerpt {
  font-size: 1.125rem;
  color: var(--hexy-muted);
  line-height: 1.6;
}

.page-thumbnail {
  margin-bottom: 2rem;
  border-radius: .5rem;
  overflow: hidden;
}

.page-featured-image {
  width: 100%;
  height: auto;
  display: block;
}

.page-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.page-content h2 {
  font-size: 1.875rem;
  margin: 2.5rem 0 1rem;
  color: var(--hexy-text);
}

.page-content h3 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  color: var(--hexy-text);
}

.page-content p {
  margin-bottom: 1.5rem;
}

.page-content ul,
.page-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.page-content blockquote {
  border-left: 4px solid var(--hexy-primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--hexy-muted);
}

.page-content img,
.page-content iframe,
.page-content video,
.page-content embed {
  max-width: 100%;
  height: auto;
  border-radius: .5rem;
}

.page-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hexy-card-brd);
  font-size: 0.875rem;
  color: var(--hexy-muted);
}

/* ---------- 15. ユーティリティ ------------------------------------- */
.hexy-gradient {
  background-image: linear-gradient(135deg, var(--hexy-grad-from), var(--hexy-grad-to));
  color: #fff;
}

.hexy-divider {
  height: 1px;
  background: var(--hexy-card-brd);
  margin: 2rem 0;
}

/* ---------- 16. フォーム入力のズーム対策 --------------------------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
textarea,
select {
  font-size: 16px !important;
  -webkit-text-size-adjust: 100%;
}

input:focus,
textarea:focus,
select:focus {
  font-size: 16px !important;
}

/* ---------- 17. アニメーション ------------------------------------- */
@keyframes hexy-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hexy-fade-enter {
  animation: hexy-fade-in .35s ease-out both;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 水溜まりローディングアニメーション */
@keyframes hexy-water-fill {
  0% {
    top: 100%;
  }
  100% {
    top: 0%;
  }
}

/* 水面の波アニメーション */
@keyframes hexy-water-wave {
  0% {
    top: 100%;
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    top: 0%;
    opacity: 1;
  }
}

/* 波の左右移動 */
@keyframes hexy-wave-move {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ローディング中の発光エフェクト */
@keyframes hexy-subtle-glow {
  0% {
    box-shadow: 0 0 20px rgba(25, 225, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 30px rgba(228, 72, 255, 0.5);
  }
}

/* ---------- 18. 個別ページの調整 ----------------------------------- */
.single-timeline_post .wp-block-site-title,
.single-timeline_post .wp-block-site-tagline {
  display: none;
}

.single-timeline_post .hexy-container {
  padding-top: 2rem;
}

/* ---------- 19. レスポンシブ対応 ----------------------------------- */
@media (max-width: 640px) {
  /* ヘッダー */
  .site-header {
    padding: 0 1rem;
  }
  
  .site-title {
    font-size: 1rem;
  }
  
  /* ナビゲーション */
  .primary-nav,
  .desktop-nav {
    gap: .75rem;
  }
  
  .primary-nav ul,
  .desktop-nav ul {
    gap: .75rem;
  }
  
  /* スペーシング */
  .site-header + * {
    margin-top: 1.5rem;
  }
  
  main,
  .site-main,
  .site-content {
    padding-top: 1.5rem;
  }
  
  .hexy-container:first-child {
    padding-top: 1.5rem;
  }
  
  #hexy-post-form,
  #hexy-timeline {
    margin-top: 1.5rem;
  }
  
  /* 投稿フォーム */
  .hexy-post-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .hexy-post-actions-left {
    justify-content: center;
    order: 2;
  }
  
  .hexy-post-actions-right {
    justify-content: center;
    order: 1;
  }
  
  .hexy-post-btn {
    width: 100%;
    justify-content: center;
  }
  
  #hexy-status {
    text-align: center;
    margin-right: 0;
  }
  
  /* 画像プレビュー */
  .hexy-image-preview-item {
    width: 70px;
    height: 70px;
  }
  
  .hexy-image-preview {
    gap: 0.5rem;
  }
  
  .hexy-image-preview-remove {
    width: 20px;
    height: 20px;
    font-size: 12px;
    top: -6px;
    right: -6px;
  }
  
  /* 固定ページ */
  .hexy-page {
    padding: 1.5rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .page-content {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hexy-image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 1rem;
  }
  
  .hexy-card {
    padding: 1rem;
  }
  
  #hexy-post-form textarea {
    min-height: 120px;
  }
  
  /* タイムラインフッター（モバイル対応） */
  .hexy-timeline-footer-content {
    padding: 2rem 1.5rem;
  }
  
  .hexy-logo-gradient {
    font-size: 1.5rem;
  }
  
  .hexy-timeline-footer-text p {
    font-size: 1rem;
  }
  
  .hexy-timeline-footer-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.8125rem;
  }
}

/* ユーザープロフィールページ */
.hexy-profile-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--hexy-bg-primary);
    min-height: 100vh;
}

.hexy-profile-cover {
    height: 200px;
    background-color: var(--hexy-bg-secondary);
    background-size: cover;
    background-position: center;
    position: relative;
}

.hexy-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--hexy-bg-primary);
    margin-top: -60px;
    position: relative;
}

/**
 * HEXY タイムライン空白修正
 * style.css に追加するか、既存のスタイルを修正
 */

/* ユーザー情報のレイアウト修正 */
.hexy-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.hexy-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.hexy-author-clickable {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hexy-author-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
    min-width: 0;
    flex: 1;
}

/* アバター */
.hexy-author__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.2s;
}

/* 名前とハンドルのコンテナ */
.hexy-author-link > div {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

/* ユーザー名 */
.hexy-author__name {
    display: block;
    font-weight: 600;
    color: var(--hexy-text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* @ハンドル */
.hexy-author__handle {
    display: inline-block;
    color: var(--hexy-text-muted, #6b7280);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 認証バッジ */
.hexy-author__badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

/* 日付 */
.hexy-date {
    font-size: 0.875rem;
    color: var(--hexy-text-muted, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

/* カード全体のリンク */
.hexy-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 投稿本文 */
.hexy-card p {
    margin: 0 0 1rem 0;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 最後の要素のマージンを削除 */
.hexy-card > *:last-child,
.hexy-card-link > *:last-child {
    margin-bottom: 0;
}

/* URLプレビューカード */
.hexy-linkcard {
    display: flex;
    margin-top: 1rem;
    border: 1px solid var(--hexy-border, #374151);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.hexy-linkcard:hover {
    border-color: var(--hexy-primary, #3b82f6);
    transform: translateY(-1px);
}

/* 画像グリッドの修正 */
.hexy-image-grid,
[class*="hexy-image-grid-"] {
    margin: 1rem 0;
}

/* フィギュア要素のリセット */
.hexy-card figure {
    margin: 0;
    padding: 0;
}

/* 不要な空白を削除 */
.hexy-card br:last-child {
    display: none;
}

/* リストアイテムの余白調整 */
#hexy-timeline > li {
    margin-bottom: 1rem;
}

#hexy-timeline > li:last-child {
    margin-bottom: 0;
}

/* ホバー効果 */
.hexy-author-link:hover {
    opacity: 0.8;
}

.hexy-author-link:hover .hexy-author__name {
    text-decoration: underline;
}

.hexy-author-link:hover .hexy-author__avatar {
    transform: scale(1.05);
}
