/* ============================================
   Glossary Styles - Skyline Horizon Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap');

:root {
  --sky-blue: #0ea5e9;
  --deep-navy: #0c2d57;
  --electric-cyan: #22d3ee;
  --light-sky: #e0f2fe;
  --pale-sky: #f0f9ff;
  --white: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --card-shadow: 0 4px 24px rgba(14, 165, 233, 0.08);
  --card-hover-shadow: 0 8px 40px rgba(14, 165, 233, 0.16);
  --gradient-header: linear-gradient(135deg, var(--sky-blue) 0%, var(--deep-navy) 100%);
  --font-main: 'Outfit', 'Noto Sans JP', sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
  --z-header: 1000;
  --z-hamburger: 1010;
  --z-overlay: 999;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  color: var(--text-primary);
  background: var(--pale-sky);
  line-height: 1.8;
  font-size: 16px;
  overflow-x: hidden;
}

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

a {
  color: var(--sky-blue);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--electric-cyan); }

/* --- Header --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--gradient-header);
  height: var(--header-height);
  box-shadow: 0 2px 16px rgba(12, 45, 87, 0.2);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo a {
  color: var(--white);
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}
.logo a:hover { color: var(--electric-cyan); }

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-menu ul li a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-menu ul li a:hover,
.nav-menu ul li a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.15);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: var(--z-hamburger);
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Glossary Layout --- */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + 2rem) 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb ul, .breadcrumb ol {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.breadcrumb li + li::before {
  content: '>';
  margin-right: 0.5rem;
}

.breadcrumb a { color: var(--sky-blue); }

/* --- Glossary Index --- */
.glossary-category {
  margin-bottom: 2.5rem;
}

.glossary-category h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--deep-navy);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--electric-cyan);
  margin-bottom: 1rem;
}

.term-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
}

.term-card {
  background: var(--white);
  border-radius: 10px;
  border-left: 4px solid var(--sky-blue);
  padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow);
  transition: all var(--transition);
}

.term-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

.term-card a {
  font-weight: 600;
  color: var(--deep-navy);
  display: block;
}

.term-card a:hover { color: var(--sky-blue); }

.term-card p, .term-card .term-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  line-height: 1.6;
}

/* --- Glossary Detail --- */
.term-header {
  margin-bottom: 1.5rem;
}

.term-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--deep-navy);
  line-height: 1.4;
}

.category-label {
  display: inline-block;
  background: var(--light-sky);
  color: var(--sky-blue);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.term-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--deep-navy);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 3px solid var(--electric-cyan);
}

.term-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--deep-navy);
  margin: 1.5rem 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--sky-blue);
}

.term-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.term-content ul, .term-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.term-content li { margin-bottom: 0.4rem; }

/* --- External Links --- */
.external-links {
  background: var(--light-sky);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 2rem;
}

.external-links h2 {
  border: none;
  margin-top: 0;
  font-size: 1.1rem;
}

.external-links ul {
  list-style: none;
  padding: 0;
}

.external-links li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.external-links li::before {
  content: '🔗';
  position: absolute;
  left: 0;
}

/* --- Sidebar --- */
.sidebar, .glossary-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  align-self: start;
}

.sidebar-nav, .sidebar-section {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
}

.sidebar-nav h3, .sidebar-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--deep-navy);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--electric-cyan);
}

.sidebar-nav ul, .sidebar-section ul {
  list-style: none;
  padding: 0;
}

.sidebar-nav li, .sidebar-section li { margin-bottom: 0.4rem; }

.sidebar-nav a, .sidebar-section a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sidebar-nav a:hover, .sidebar-section a:hover { color: var(--sky-blue); }

/* --- Ad Banners --- */
.ad-banner, .amazon-banner {
  background: var(--light-sky);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
}

/* --- Footer --- */
footer {
  background: var(--deep-navy);
  color: rgba(255, 255, 255, 0.8);
  margin-top: 3rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.footer-section h3 {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-section p { font-size: 0.85rem; }

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li { margin-bottom: 0.4rem; }

.footer-section ul li a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.footer-section ul li a:hover { color: var(--electric-cyan); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-links {
  text-align: center;
}

.footer-links ul { list-style: none; padding: 0; }
.footer-links ul li { margin-bottom: 0.4rem; }
.footer-links ul li a { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; }
.footer-links h4 { color: var(--white); font-size: 1rem; margin-bottom: 1rem; }

/* --- Responsive --- */
@media (max-width: 992px) {
  .page-container { grid-template-columns: 1fr; }
  .sidebar, .glossary-sidebar { position: static; }
  .footer-content { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --header-height: 56px; }

  .hamburger { display: flex; }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--deep-navy);
    padding: 5rem 1.5rem 2rem;
    transition: right var(--transition);
    z-index: var(--z-overlay);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .nav-menu.active { right: 0; }

  .nav-menu ul { flex-direction: column; gap: 0; }

  .nav-menu ul li a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
  }

  .term-list { grid-template-columns: 1fr; }

  body { word-break: break-word; overflow-wrap: break-word; }
}

/* --- Nav Overlay --- */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-overlay) - 1);
}
.nav-overlay.active { display: block; }

/* --- Scroll-to-top --- */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--gradient-header);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(12, 45, 87, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 100;
}
.scroll-to-top.visible { opacity: 1; visibility: visible; }
