/*
Theme Name: AND LENS
Theme URI: https://bunkyo.and-lens.jp
Author: sumairuTV
Author URI: https://www.youtube.com/@sumairuTV
Description: 文京区中古マンション情報局 AND LENS 専用テーマ。フロントページ(静的HTML)とWordPress記事ページの共存設計。
Version: 1.7.4
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: Private
Text Domain: andlens
*/

/* ============================================
   AND LENS Design System
   Primary: #f01e79 (Pink)
   Background: #F5F5F7
   Navy: #1a1a2e
   ============================================ */

:root {
  --pri: #f01e79;
  --pri-dark: #e2496d;
  --pri-light: #ed85a5;
  --pri-50: #FEF2F8;
  --navy: #1a1a2e;
  --navy-light: #2d2d5e;
  --bg: #F5F5F7;
  --card: #ffffff;
  --text: #1a1a2e;
  --sub: #6B7280;
  --border: #E5E7EB;
  --up: #16a34a;
  --down: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.1);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

/* --- Global Header --- */
.al-global-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.al-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.al-logo img {
  height: 32px;
  width: auto;
}

.al-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.al-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--sub);
  text-decoration: none;
  transition: color .2s;
  padding: 4px 0;
}

.al-nav a:hover,
.al-nav a.active {
  color: var(--pri);
}

/* Mobile nav toggle */
.al-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--navy);
}

@media (max-width: 768px) {
  .al-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .al-nav.open {
    display: flex;
  }
  .al-nav-toggle {
    display: block;
  }
}

/* --- Main Content --- */
.al-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* --- Article --- */
.al-article-header {
  margin-bottom: 32px;
}

.al-article-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--navy);
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .al-article-header h1 {
    font-size: 22px;
  }
}

.al-article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--sub);
}

.al-article-meta time {
  color: var(--sub);
}

.al-category-badge {
  display: inline-block;
  background: var(--pri-50);
  color: var(--pri);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

/* --- Article Body (Gutenberg content) --- */
.al-article-body {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
}

.al-article-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--pri);
  color: var(--navy);
}

.al-article-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--navy);
}

.al-article-body p {
  margin-bottom: 20px;
}

.al-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.al-article-body ul, .al-article-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.al-article-body li {
  margin-bottom: 8px;
}

.al-article-body blockquote {
  border-left: 4px solid var(--pri);
  background: var(--pri-50);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-style: italic;
  color: var(--navy);
}

.al-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.al-article-body th {
  background: var(--navy);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}

.al-article-body td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.al-article-body tr:hover td {
  background: var(--pri-50);
}

.al-article-body code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

.al-article-body pre {
  background: var(--navy);
  color: #e5e7eb;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.al-article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* --- Author Box --- */
.al-author-box {
  margin: 48px 0 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.al-author-box-title {
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
}

.al-author-box-inner {
  display: flex;
  gap: 20px;
  padding: 24px 20px;
}

.al-author-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.al-author-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.al-author-bio {
  font-size: 14px;
  line-height: 1.7;
  color: var(--sub);
  margin-bottom: 12px;
}

.al-author-social {
  display: flex;
  gap: 12px;
}

.al-author-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--sub);
  transition: all .2s;
}

.al-author-social a:hover {
  background: var(--pri-50);
  color: var(--pri);
}

@media (max-width: 480px) {
  .al-author-box-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .al-author-social {
    justify-content: center;
  }
}

/* --- CTA Section --- */
.al-cta {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  margin: 48px 0 32px;
}

.al-cta h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.al-cta p {
  font-size: 14px;
  opacity: .85;
  margin-bottom: 20px;
  line-height: 1.7;
}

.al-cta-btn {
  display: inline-block;
  background: var(--pri);
  color: white;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 100px;
  text-decoration: none;
  transition: all .2s;
}

.al-cta-btn:hover {
  background: var(--pri-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240,30,121,.3);
}

/* --- Related Posts --- */
.al-related {
  margin-top: 48px;
}

.al-related h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--navy);
}

.al-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.al-related-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s;
}

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

.al-related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.al-related-card-body {
  padding: 14px 16px;
}

.al-related-card-body h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 6px;
}

.al-related-card-body time {
  font-size: 12px;
  color: var(--sub);
}

/* --- Breadcrumb --- */
.al-breadcrumb {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 24px;
}

.al-breadcrumb a {
  color: var(--sub);
  text-decoration: none;
}

.al-breadcrumb a:hover {
  color: var(--pri);
}

.al-breadcrumb span {
  margin: 0 6px;
}

/* --- Footer (フロントページと統一) --- */
.al-global-footer {
  background: var(--navy);
  padding: 28px 0 20px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.08);
}

.al-footer-sns {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.al-footer-sns a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.65);
  transition: background .2s, color .2s, transform .2s;
  text-decoration: none;
}

.al-footer-sns a:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  transform: translateY(-2px);
}

.al-footer-sns svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.al-footer-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 14px;
}

.al-footer-nav a {
  font-size: 12px;
  opacity: .7;
  text-decoration: none;
  color: #fff;
}

.al-footer-nav a:hover {
  opacity: 1;
}

.al-footer-brand {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.al-footer-brand span {
  color: rgba(255,255,255,.4);
  font-weight: 400;
  margin: 0 6px;
}

.al-footer-operator {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  margin-bottom: 12px;
}

.al-footer-copy {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  margin: 0;
}

/* --- 404 Page --- */
.al-404 {
  text-align: center;
  padding: 80px 20px;
}

.al-404 h1 {
  font-size: 72px;
  font-weight: 800;
  color: var(--border);
  margin-bottom: 16px;
}

.al-404 p {
  font-size: 16px;
  color: var(--sub);
  margin-bottom: 24px;
}

/* --- Archive (Post List) --- */
.al-archive-header {
  margin-bottom: 32px;
}

.al-archive-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}

.al-post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.al-post-card {
  display: flex;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s;
}

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

.al-post-card-thumb {
  width: 200px;
  min-height: 140px;
  object-fit: cover;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .al-post-card {
    flex-direction: column;
  }
  .al-post-card-thumb {
    width: 100%;
    height: 180px;
  }
}

.al-post-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.al-post-card-body h2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
  color: var(--navy);
}

.al-post-card-body p {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.al-post-card-meta {
  font-size: 12px;
  color: var(--sub);
  margin-top: 8px;
}

/* --- Pagination --- */
.al-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.al-pagination a,
.al-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--sub);
  background: var(--card);
  border: 1px solid var(--border);
  transition: all .2s;
}

.al-pagination a:hover {
  color: var(--pri);
  border-color: var(--pri);
}

.al-pagination .current {
  background: var(--pri);
  color: white;
  border-color: var(--pri);
}

/* ============================================
   Data Pages — Area / School
   ============================================ */

.al-main-wide {
  max-width: 960px;
}

/* Data Hero */
.al-data-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.al-data-hero-icon {
  width: 64px;
  height: 64px;
  background: var(--pri-50);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.al-data-hero h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.al-data-hero-sub {
  font-size: 14px;
  color: var(--sub);
  line-height: 1.7;
}

@media (max-width: 600px) {
  .al-data-hero { flex-direction: column; text-align: center; }
  .al-data-hero h1 { font-size: 20px; }
  .al-data-hero-sub br { display: none; }
}

/* Stats Grid */
.al-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}

@media (max-width: 600px) {
  .al-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.al-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  text-align: center;
}

.al-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.al-stat-value.al-stat-pink {
  color: var(--pri);
}

.al-stat-label {
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
  font-weight: 600;
}

/* Section */
.al-section {
  margin-bottom: 40px;
}

.al-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--pri);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.al-section-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--pri);
  border-radius: 2px;
}

.al-section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.al-section-desc {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 24px;
  line-height: 1.7;
}

/* Area / School Cards Grid */
.al-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .al-area-grid { grid-template-columns: 1fr; }
}

.al-area-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: all .2s;
}

.al-area-card:hover {
  border-color: var(--pri);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(240,30,121,.08);
}

.al-school-card:hover {
  border-color: var(--navy);
  box-shadow: 0 4px 16px rgba(26,26,46,.08);
}

.al-area-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.al-area-card-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
}

.al-area-card-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--pri);
  background: var(--pri-50);
  padding: 3px 10px;
  border-radius: 20px;
}

.al-area-card-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}

.al-area-card-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.al-acs-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.al-acs-lbl {
  font-size: 10px;
  color: var(--sub);
  font-weight: 600;
}

.al-area-card-desc {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.6;
}

/* Data Table */
.al-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.al-data-table th {
  background: var(--navy);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.al-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.al-data-table tr:hover td {
  background: var(--pri-50);
}

.al-num {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Note Box */
.al-note-box {
  background: #f0fdf4;
  border: 1px solid #c6f0d5;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 32px 0;
  font-size: 13px;
  color: #3d7a50;
  line-height: 1.7;
}
