/*
Theme Name: e-Creators
Theme URI: https://e-creators.jp/
Author: e-Creators
Author URI: https://e-creators.jp/
Description: ものづくりの最前線で、新しい可能性を切り拓く。電子工作サークル e-Creators のカスタムテーマ。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: e-creators
Tags: dark, tech, single-page, custom-menu, featured-images, translation-ready
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg:          #0a0e14;
  --bg2:         #111620;
  --bg3:         #161d2a;
  --accent:      #00e5ff;
  --accent2:     #7b61ff;
  --accent3:     #00ff9d;
  --text:        #c8d8e8;
  --text-muted:  #5a7080;
  --border:      rgba(0, 229, 255, 0.18);
  --grid:        rgba(0, 229, 255, 0.04);
  --glow:        0 0 20px rgba(0, 229, 255, 0.25);
  --font-mono:   'Share Tech Mono', 'Courier New', monospace;
  --font-display:'Orbitron', sans-serif;
  --font-body:   'Noto Sans JP', sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
}

/* PCB grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: #fff; }

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

ul, ol { list-style: none; }

/* ============================================================
   UTILITY
   ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-label::before {
  content: '//';
  opacity: 0.5;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 3rem;
  letter-spacing: 0.04em;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 0.85rem 2rem;
  border: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background: #fff;
  color: var(--bg);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.85rem 2rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  background: transparent;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.07);
  color: var(--accent);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ============================================================
   ANNOUNCEMENT BANNER
   ============================================================ */
#announcement-bar {
  position: relative;
  z-index: 10;
  background: linear-gradient(90deg, rgba(0,229,255,0.12), rgba(123,97,255,0.12));
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.announcement-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  background: var(--accent);
  color: var(--bg);
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 700;
}

.announcement-text {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.announcement-text strong {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: top 0.3s;
}

/* announcement barが表示されているときはその分下にずれる */
body.has-announcement #site-header {
  top: 40px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-shadow: var(--glow);
  text-decoration: none;
  transition: opacity 0.2s;
}

.site-logo:hover { opacity: 0.8; color: var(--accent); }

.site-logo span { color: #fff; }

/* WordPress wp_nav_menu が出力する ul */
#primary-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

#primary-menu li a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}

#primary-menu li a:hover,
#primary-menu li.current-menu-item a {
  color: var(--accent);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  transition: all 0.2s;
}

.nav-cta:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: var(--glow);
  color: var(--accent);
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--accent);
  transition: all 0.3s;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 2rem 6rem;
  z-index: 1;
  overflow: hidden;
}

#hero::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(0,229,255,0.06) 0%, transparent 70%);
  transform: translateY(-50%);
  pointer-events: none;
}

/* 左上の装飾ライン */
#hero::before {
  content: '';
  position: absolute;
  top: 120px;
  left: 0;
  width: 180px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent));
  opacity: 0.4;
}

.hero-inner {
  max-width: 900px;
  width: 100%;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeUp 0.6s ease 0.1s both;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #fff;
  margin-bottom: 0.5rem;
  animation: fadeUp 0.6s ease 0.25s both;
}

.hero-title .accent { color: var(--accent); }

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--text-muted);
  margin: 1.5rem 0 3rem;
  max-width: 620px;
  font-weight: 300;
  line-height: 2;
  animation: fadeUp 0.6s ease 0.4s both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeUp 0.6s ease 0.55s both;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  animation: fadeUp 0.6s ease 0.8s both;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollpulse 2s ease-in-out infinite;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
#about {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 2;
  margin-bottom: 1.5rem;
}

.about-text p:last-child { margin-bottom: 0; }

/* Stats panel */
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

.stat-cell {
  background: var(--bg2);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}

.stat-cell:hover { background: var(--bg3); }

.stat-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-cell:hover::before { opacity: 1; }

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-value.small {
  font-size: 1rem;
  color: #fff;
  margin-top: 0.3rem;
}

.stat-value.green {
  color: var(--accent3);
  font-size: 1rem;
  margin-top: 0.3rem;
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================================
   ACTIVITIES SECTION
   ============================================================ */
#activities {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.activities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.activity-card {
  background: var(--bg);
  padding: 2rem 1.75rem;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}

.activity-card:hover { background: var(--bg3); }

.activity-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(to right, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.activity-card:hover::after { opacity: 1; }

.activity-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 1.25rem;
  color: var(--accent);
  opacity: 0.85;
}

.activity-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 0.75rem;
}

.activity-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.9;
}

/* ============================================================
   WORKS SECTION (WordPress Loop)
   ============================================================ */
#works {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
}

.works-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.work-card {
  background: var(--bg2);
  overflow: hidden;
  position: relative;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
}

.work-card:hover { background: var(--bg3); }

.work-card .work-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  filter: brightness(0.7) saturate(0.8);
  transition: filter 0.3s;
}

.work-card:hover .work-thumbnail {
  filter: brightness(0.9) saturate(1.1);
}

.work-thumbnail-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.work-body {
  padding: 1.5rem;
  flex: 1;
}

.work-category {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  transition: border-color 0.2s;
}

.work-card:hover .work-category {
  border-color: rgba(0, 229, 255, 0.5);
}

.work-title {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.work-event {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 投稿がない場合のメッセージ */
.no-works {
  grid-column: 1 / -1;
  padding: 3rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: var(--bg2);
}

/* 単一投稿ページ */
.single-work {
  max-width: 860px;
  margin: 0 auto;
  padding: 8rem 2rem 6rem;
  position: relative;
  z-index: 1;
}

.single-work .work-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 2.5rem;
  filter: brightness(0.85) saturate(0.9);
}

.single-work h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.single-work .work-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.single-work .work-content {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--text);
}

.single-work .work-content h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #fff;
  margin: 2.5rem 0 1rem;
  letter-spacing: 0.04em;
}

.single-work .work-content p {
  margin-bottom: 1.25rem;
}

.single-work .work-content img {
  width: 100%;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
#contact {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
}

.contact-wrap {
  border: 1px solid var(--border);
  padding: 4rem;
  position: relative;
  overflow: hidden;
  background: var(--bg2);
}

.contact-wrap::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(ellipse, rgba(123, 97, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.contact-lead {
  font-size: 1rem;
  color: var(--text);
  max-width: 600px;
  line-height: 2;
  margin-bottom: 2.5rem;
}

.contact-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.contact-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-meta-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.contact-meta-value {
  font-size: 0.9rem;
  color: var(--text);
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.footer-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ============================================================
   WORDPRESS ADMIN BAR OFFSET
   ============================================================ */
.admin-bar #site-header {
  top: 32px;
}

.admin-bar body.has-announcement #site-header {
  top: 72px;
}

@media screen and (max-width: 782px) {
  .admin-bar #site-header {
    top: 46px;
  }
}

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

@keyframes scrollpulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(0.7); }
}

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 900px) {
  .about-grid        { grid-template-columns: 1fr; }
  .activities-grid   { grid-template-columns: repeat(2, 1fr); }
  .works-grid        { grid-template-columns: 1fr; }
  .contact-meta-grid { grid-template-columns: 1fr; }
  .contact-wrap      { padding: 2.5rem; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 640px) {
  .nav-links-wrap { display: none; }

  .nav-toggle { display: flex; }

  /* モバイルメニュー open 状態 */
  .nav-links-wrap.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: rgba(10, 14, 20, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem 2rem;
    gap: 1.5rem;
    z-index: 99;
  }

  .nav-links-wrap.is-open #primary-menu {
    flex-direction: column;
    align-items: flex-start;
  }

  #hero { padding: 110px 1.5rem 5rem; }

  .hero-title { font-size: 2.2rem; }

  #about, #works, #contact { padding: 4rem 0; }

  .activities-grid { grid-template-columns: 1fr; }

  .stat-row { grid-template-columns: 1fr; }

  #site-footer {
    flex-direction: column;
    text-align: center;
  }

  .contact-wrap { padding: 2rem 1.5rem; }

  .section-title { margin-bottom: 2rem; }
}

/* ============================================================
   WORDPRESS WYSIWYG (管理画面エディタ用)
   ============================================================ */
.wp-block-image img { border: 1px solid var(--border); }
.wp-block-quote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  color: var(--text-muted);
  font-style: italic;
}
