/*
Theme Name: CompassTV
Theme URI: https://compasstv.co.jp
Author: CompassTV Inc.
Author URI: https://compasstv.co.jp
Description: コンパスティービー株式会社 コーポレートサイト用オリジナルテーマ
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: All Rights Reserved
Text Domain: compasstv
*/

/* =========================================================
   Brand Colors & Design Tokens
   ========================================================= */
:root {
  /* Brand */
  --primary:              oklch(60.42% 0.212 32.60);
  --primary-hover:        oklch(50% 0.212 32.60);
  --primary-tint:         oklch(from var(--primary) l c h / 0.1);
  --primary-subtle:       oklch(from var(--primary) l c h / 0.04);
  --primary-ring:         oklch(from var(--primary) l c h / 0.15);
  --primary-foreground:   oklch(1 0 0);

  --secondary:            oklch(0.95 0.1658 76.58);
  --secondary-hover:      oklch(1 0 0);
  --secondary-foreground: oklch(0.145 0 0);

  --accent:               oklch(35.61% 0.160 263.68);
  --accent-foreground:    oklch(1 0 0);

  /* Surface */
  --bg:          oklch(0.945 0.008 263);
  --surface:     oklch(1 0 0);
  --border:      oklch(0.88 0 0);

  /* Text */
  --text:        oklch(0.18 0 0);
  --text-muted:  oklch(0.5 0 0);
  --text-on-dark: oklch(1 0 0);

  /* Footer */
  --footer-link:   oklch(1 0 0);
  --footer-border: oklch(1 0 0 / 0.15);

  /* Shadows */
  --shadow-header: 0 1px 8px oklch(0 0 0 / 0.06);
  --shadow-sm:     0 2px 12px oklch(0 0 0 / 0.1);
  --shadow-md:     0 8px 24px oklch(0 0 0 / 0.18);
  --shadow-lg:     0 12px 32px oklch(0 0 0 / 0.18);

  --radius:      8px;
  --radius-lg:   16px;

  --space-xs:    0.5rem;
  --space-sm:    1rem;
  --space-md:    2rem;
  --space-lg:    4rem;
  --space-xl:    6rem;

  --container:   1200px;

  --font-sans:   'Inter', 'Noto Sans JP', sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.75;

  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text);
  background-color: var(--bg);
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul, ol {
  list-style: none;
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.5rem); }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* =========================================================
   Layout Utilities
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section {
  padding-block: var(--space-xl);
}

.section--alt {
  background-color: var(--surface);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.section__title {
  color: var(--text);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn--primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-foreground);
}

.btn--secondary {
  background-color: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}

.btn--secondary:hover {
  background-color: var(--secondary-hover);
  border-color: var(--secondary-hover);
  color: var(--primary);
}

.btn--outline {
  background-color: transparent;
  color: var(--primary-foreground);
  border-color: var(--primary-foreground);
}

.btn--outline:hover {
  background-color: var(--primary-foreground);
  color: var(--primary);
}

.btn--footer {
  background-color: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent-foreground);
}

.btn--footer:hover {
  background-color: var(--accent-foreground);
  color: var(--accent);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-header__logo {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header__logo span {
  color: var(--primary);
}

/* Primary Nav */
.primary-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.primary-nav__list a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.primary-nav__list a:hover,
.primary-nav__list .current-menu-item > a {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background-color: var(--accent);
  color: var(--accent-foreground);
  padding-block: var(--space-lg);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.site-footer__brand-name {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: var(--space-xs);
}

.site-footer__brand-name span {
  color: var(--secondary);
}

.site-footer__tagline {
  font-size: 0.85rem;
  opacity: 0.75;
}

.site-footer__nav-title,
.site-footer__widget-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  margin-bottom: var(--space-sm);
}

.site-footer__nav-list li + li {
  margin-top: 0.5rem;
}

.site-footer__nav-list a {
  color: var(--footer-link);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.site-footer__nav-list a:hover {
  color: var(--secondary);
}

.site-footer__bottom {
  border-top: 1px solid var(--footer-border);
  padding-top: var(--space-md);
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.65;
}

/* =========================================================
   Hero Section
   ========================================================= */
.hero {
  position: relative;
  width: 100%;
  min-height: 90vh;
  display: flex;
  align-items: center;
  background-color: var(--primary);
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-md);
  padding-block: var(--space-xl);
}

.hero__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: var(--space-sm);
  animation: fadeInUp 0.6s ease both;
}

.hero__title {
  color: var(--accent-foreground);
  margin-bottom: var(--space-md);
  animation: fadeInUp 0.6s 0.1s ease both;
}

.hero__title strong {
  color: var(--secondary);
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-on-dark);
  max-width: 560px;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.6s 0.2s ease both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  animation: fadeInUp 0.6s 0.3s ease both;
}

/* =========================================================
   Service Cards
   ========================================================= */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}

.service-card {
  background-color: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.service-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background-color: var(--primary-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.service-card__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  stroke-width: 1.75;
  fill: none;
}

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

.service-card__body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* =========================================================
   About Snippet
   ========================================================= */
.about-snippet {
  background-color: var(--surface);
}

.about-snippet__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.about-snippet__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.about-snippet__title {
  margin-bottom: var(--space-md);
}

.about-snippet__body {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.about-snippet__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.about-snippet__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   News List
   ========================================================= */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--space-sm);
  align-items: baseline;
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition);
}

.news-item:hover {
  background-color: var(--primary-subtle);
}

.news-item__date {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.news-item__title a {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  transition: color var(--transition);
}

.news-item__title a:hover {
  color: var(--primary);
}

.news__more {
  text-align: center;
  margin-top: var(--space-lg);
}

/* =========================================================
   CTA Banner
   ========================================================= */
.cta-banner {
  background-color: var(--primary);
  color: var(--primary-foreground);
  text-align: center;
  padding-block: var(--space-xl);
}

.cta-banner__title {
  color: var(--primary-foreground);
  margin-bottom: var(--space-sm);
}

.cta-banner__body {
  color: var(--text-on-dark);
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
}

/* =========================================================
   Archive Page
   ========================================================= */
.archive-header {
  background-color: var(--accent);
  color: var(--accent-foreground);
  padding-block: var(--space-lg);
  text-align: center;
}

.archive-header__title {
  color: var(--accent-foreground);
}

.archive-posts {
  padding-block: var(--space-xl);
}

.post-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-md);
  background-color: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.post-card__thumbnail {
  aspect-ratio: 16 / 9;
  background-color: var(--border);
  overflow: hidden;
}

.post-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-card__date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.post-card__title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.post-card__title a {
  color: var(--text);
}

.post-card__title a:hover {
  color: var(--primary);
}

.post-card__excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-lg);
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color var(--transition), color var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

/* =========================================================
   Single Post
   ========================================================= */
.single-header {
  background-color: var(--accent);
  color: var(--accent-foreground);
  padding-block: var(--space-lg);
}

.single-header__date {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.single-header__title {
  color: var(--accent-foreground);
}

.single-content {
  padding-block: var(--space-xl);
}

.single-content__thumbnail {
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.entry-content {
  max-width: 760px;
  margin-inline: auto;
}

.entry-content h2 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  padding-left: 1rem;
  border-left: 4px solid var(--primary);
}

.entry-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.entry-content p {
  color: var(--text-muted);
}

.entry-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.single-nav {
  max-width: 760px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding-block: var(--space-lg);
  border-top: 1px solid var(--border);
}

.single-nav__link {
  font-size: 0.875rem;
  color: var(--text-on-dark);
}

.single-nav__link--next {
  text-align: right;
}

.single-nav__link a {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-top: 0.25rem;
}

/* =========================================================
   Page Template
   ========================================================= */
.page-header {
  background-color: var(--accent);
  color: var(--accent-foreground);
  padding-block: var(--space-lg);
  text-align: center;
}

.page-header__title {
  color: var(--accent-foreground);
}

.page-content {
  padding-block: var(--space-xl);
}

.page-content .entry-content {
  max-width: 800px;
}

/* Contact Form 7 overrides */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea,
.wpcf7-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background-color: var(--surface);
  transition: border-color var(--transition);
  margin-bottom: 1rem;
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.wpcf7-form input[type="submit"] {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  padding: 0.875rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition);
}

.wpcf7-form input[type="submit"]:hover {
  background-color: var(--primary-hover);
}

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

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

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

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .about-snippet__inner {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .about-snippet__image {
    order: -1;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card__thumbnail {
    max-height: 200px;
  }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 4rem;
    --space-lg: 2.5rem;
  }

  /* Header mobile */
  .primary-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background-color: var(--surface);
    padding: var(--space-md);
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
    z-index: 99;
  }

  .primary-nav.is-open {
    transform: translateX(0);
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .primary-nav__list a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: flex;
  }

  /* Footer */
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* News item */
  .news-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  /* Single nav */
  .single-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}
