/* ==========================================================================
   Elderly AI Concierge - Warm Companion Theme
   Theme: Care, Warmth, Accessibility
   Colors: Soft Orange, Warm Beige, Gentle Green, Readable Dark Gray
   Typography: Large, Clear Sans-Serif
   ========================================================================== */

:root {
  /* Warm Palette */
  --primary-color: #ea580c;
  /* Orange 600 - Warm & Visible */
  --primary-light: #fdba74;
  /* Orange 300 */
  --secondary-color: #15803d;
  /* Green 700 - Calming Nature */
  --accent-color: #fca5a5;
  /* Red 300 - Gentle highlight */

  --bg-warm: #fff7ed;
  /* Orange 50 (Very light warm beige) */
  --bg-white: #ffffff;
  --bg-soft-green: #f0fdf4;

  --text-dark: #1c1917;
  /* Stone 900 (Softer black) */
  --text-medium: #44403c;
  /* Stone 700 */
  --text-light: #78716c;
  /* Stone 500 */

  --border-color: #fed7aa;
  /* Orange 200 */

  --shadow-soft: 0 4px 20px -5px rgba(234, 88, 12, 0.15);
  --shadow-hover: 0 10px 25px -5px rgba(234, 88, 12, 0.25);

  --transition: all 0.3s ease;
  --font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;

  /* Accessibility Sizing */
  --radius-lg: 24px;
  --radius-xl: 32px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.9;
  /* Increased for readability */
  color: var(--text-dark);
  background-color: var(--bg-warm);
  font-size: 18px;
  /* Larger base font size for seniors/readability */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

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

a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Header - Simple & Clear */
.site-header {
  background: var(--bg-white);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 4px solid var(--primary-light);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: 0.05em;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
}

.nav-item a {
  color: var(--text-medium);
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-warm);
  border-radius: 50px;
}

.nav-item a:hover {
  background: var(--primary-color);
  color: white;
  text-decoration: none;
}

/* Mobile Menu Button - Large Touch Target */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
}

.hamburger-line {
  display: block;
  width: 30px;
  height: 4px;
  background: var(--primary-color);
  margin: 6px 0;
  border-radius: 4px;
}

/* Hero Section - Warm & Inviting */
.hero {
  background: linear-gradient(rgba(255, 247, 237, 0.9), rgba(255, 247, 237, 0.7)), url('images/hero-bg-realistic.png');
  background-size: cover;
  background-position: center;
  padding: 8rem 2rem 6rem;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.85);
  /* Readable container */
  padding: 3rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(5px);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #c2410c;
  /* Darker Orange */
  margin-bottom: 1rem;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 1.4rem;
  color: var(--text-medium);
  margin-bottom: 2.5rem;
  font-weight: 600;
}

.cta-button {
  display: inline-block;
  background: var(--secondary-color);
  color: white;
  padding: 1.25rem 3rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(21, 128, 61, 0.3);
  transition: transform 0.2s;
}

.cta-button:hover {
  transform: scale(1.05);
  background: #166534;
  /* Darker Green */
  color: white;
  text-decoration: none;
}

/* Main Layout - Accessible Cards */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 4rem;
}

.main-content {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 2px solid var(--border-color);
}

/* Headings with clear hierarchy */
h2 {
  font-size: 2.25rem;
  color: #c2410c;
  margin-bottom: 2rem;
  border-bottom: 4px solid var(--primary-light);
  padding-bottom: 0.5rem;
  display: inline-block;
}

h3 {
  font-size: 1.75rem;
  color: var(--secondary-color);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Grid Cards */
.news-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.news-card,
.feature-card {
  background: var(--bg-white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.news-card:hover,
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.news-date {
  background: var(--bg-warm);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 1rem;
}

.feature-card img {
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Sidebar - Clarity First */
.sidebar {
  position: sticky;
  top: 120px;
}

.sidebar-section {
  background: var(--bg-soft-green);
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 2px solid #bbf7d0;
  /* Light Green Border */
}

.sidebar-section h3 {
  font-size: 1.4rem;
  color: #15803d;
  margin-top: 0;
  border-bottom: 2px solid #86efac;
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-section li {
  margin-bottom: 1rem;
}

.sidebar-section a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 12px;
  color: var(--text-dark);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-section a:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.02);
}

/* CTA Section */
.cta-section {
  background: #ffedd5;
  /* Orange 100 */
  padding: 6rem 2rem;
  text-align: center;
  border-radius: var(--radius-xl);
  margin: 4rem 2rem;
}

.cta-section h2 {
  border-bottom: none;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.cta-btn {
  padding: 1.25rem 2.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.cta-btn.primary {
  background: var(--primary-color);
  color: white;
}

.cta-btn.primary:hover {
  background: #c2410c;
  transform: scale(1.05);
}

.cta-btn.secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.cta-btn.secondary:hover {
  background: var(--bg-warm);
}

/* Footer */
.site-footer {
  background: #431407;
  /* Very Dark Orange/Brown - Warm Dark */
  color: #fdba74;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}

.footer-section h4 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: #fed7aa;
  font-weight: 500;
}

.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 1024px) {
  .page-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.25rem;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-menu {
    display: none;
    /* Handle via JS */
  }

  .cta-buttons {
    flex-direction: column;
  }
}





/* === Mobile fix v3 (auto-injected) === */
html, body { overflow-x: hidden; }
img, video, iframe, table { max-width: 100%; }

@media (max-width: 768px) {
  /* ヒーローテキストがviewportからはみ出さないようにする */
  h1, h2, h3 {
    font-size: clamp(1.3rem, 5vw, 2.5rem) !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  p, li, td, th, span, a {
    overflow-wrap: break-word;
    word-break: break-word;
  }
  /* 全要素の幅を100vw以内に */
  .container, main, section, article, header, footer, nav,
  [class*="container"], [class*="wrapper"], [class*="content"] {
    max-width: 100vw;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}
/* === End Mobile fix v3 === */
