/* ============================================
   LocalCommunityDX News CSS
   ============================================ */

/* CSS Variables */
:root {
  --primary-color: #2E7D32;
  --secondary-color: #00BFA5;
  --accent-color: #FFA726;
  --text-dark: #1A1A1A;
  --text-light: #666666;
  --text-color-light: #f5f5f5;
  --bg-light: #F5F5F5;
  --white: #FFFFFF;
  --border-color: #E0E0E0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --transition-speed: 0.3s;

  --font-family-base: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-heading: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --header-height: 70px;
}

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

body {
  font-family: var(--font-family-base);
  line-height: 1.8;
  color: var(--text-dark);
  background-color: var(--bg-light);
  font-size: 16px;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  line-height: 1.3;
  margin-bottom: 1rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

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

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Navigation */
header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--primary-color);
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  max-width: 900px;
  justify-content: center;
}

.nav-item a {
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-item a:hover,
.nav-item.active a {
  background: var(--primary-color);
  color: var(--white);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px;
  transition: var(--transition);
}

/* Main Content Wrapper */
.main {
  padding-top: 2rem;
}

/* News Container - 2 Column Layout */
.news-container {
  padding: 4rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (min-width: 992px) {
  .news-container {
    grid-template-columns: 3fr 1fr;
  }
}

/* Main Content Area */
.main-content {
  width: 100%;
  background: var(--white);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* Article Header */
.article-header {
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 1.5rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  line-height: 1.3;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.article-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Featured Image */
.featured-image {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px var(--shadow-color);
}

/* Article Content */
.article-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-dark);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.article-content section {
  margin-bottom: 2.5rem;
}

.article-content h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin: 2.5rem 0 1rem 0;
  padding-bottom: 0.8rem;
  padding-left: 1rem;
  border-left: 5px solid var(--primary-color);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.article-content h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin: 2rem 0 1rem 0;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.article-content p {
  font-size: 1.05rem;
  line-height: 2;
  margin-bottom: 1.5rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0 1.5rem 2rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.article-content li {
  margin-bottom: 0.8rem;
  line-height: 1.8;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.article-content strong {
  color: var(--secondary-color);
  font-weight: 600;
}

.article-content img.inline-image {
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 4px 15px var(--shadow-color);
}

.article-content pre {
  background-color: #f5f5f5;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  background-color: #f5f5f5;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}

.article-content pre code {
  background-color: transparent;
  padding: 0;
}

/* News Source Section */
.news-source-section {
  margin-top: 3rem;
  padding: 2rem;
  background-color: var(--bg-light);
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
}

.news-source-section h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.news-source-section p {
  margin-bottom: 0.5rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.news-source-section a {
  color: var(--primary-color);
  word-break: break-all;
}

/* Share Buttons Section */
.cta-section {
  margin-top: 3rem;
  padding: 2rem;
  background-color: var(--bg-light);
  border-radius: 8px;
  text-align: center;
}

.cta-section h3 {
  margin-bottom: 1.5rem;
  color: var(--secondary-color);
  font-size: 1.3rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all var(--transition-speed);
  text-decoration: none;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.share-button.twitter {
  background-color: #1DA1F2;
  color: white;
}

.share-button.twitter:hover {
  background-color: #0d8bd9;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(29, 161, 242, 0.3);
}

.share-button.facebook {
  background-color: #4267B2;
  color: white;
}

.share-button.facebook:hover {
  background-color: #365899;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(66, 103, 178, 0.3);
}

.share-button.line {
  background-color: #00B900;
  color: white;
}

.share-button.line:hover {
  background-color: #009900;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 185, 0, 0.3);
}

.share-button .icon {
  font-size: 1.2rem;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 4rem);
    overflow-y: auto;
  }
}

.sidebar-section {
  background: var(--white);
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.sidebar-section h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--primary-color);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

/* Related Links */
.related-links {
  background: var(--white);
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.related-links h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--primary-color);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

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

.related-links li {
  margin-bottom: 0.75rem;
}

.related-links li a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: all var(--transition-speed);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.related-links li a:hover {
  background-color: var(--bg-light);
  border-left-color: var(--primary-color);
  padding-left: 1rem;
  color: var(--primary-color);
}

/* Ad Space */
.ad-space {
  background: var(--white);
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  min-height: 250px;
}

.ad-label {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
  margin-bottom: 0.5rem;
}

.ad-placeholder {
  min-height: 250px;
  background-color: var(--bg-light);
  border: 2px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.ad-placeholder p {
  color: #999;
  font-size: 0.9rem;
}

/* News List Widget */
.news-list {
  list-style: none;
  padding: 0;
}

.news-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.news-list li:last-child {
  border-bottom: none;
}

.news-list li a {
  color: var(--text-dark);
  font-size: 0.9rem;
  transition: color var(--transition-speed);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

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

/* Footer */
footer,
.footer {
  background: var(--text-dark);
  color: var(--white);
  padding: 3rem 0 1.5rem 0;
  margin-top: 5rem;
}

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

.footer-section h3 {
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.footer-section p,
.footer-section a {
  color: #CCCCCC;
  text-decoration: none;
  line-height: 2;
  display: block;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.footer-section a:hover {
  color: var(--secondary-color);
}

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

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

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #444;
  color: #999;
}

.footer-bottom p {
  font-size: 0.85rem;
  opacity: 0.8;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.footer-nav a {
  color: var(--text-color-light);
  opacity: 0.8;
}

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

.copyright {
  font-size: 0.9rem;
}

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

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .hamburger {
    display: flex;
  }

  .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(7px, -7px);
  }

  .sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .news-container {
    padding: 2rem 1rem;
    gap: 2rem;
  }

  header nav {
    padding: 1rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .main-content {
    padding: 1.5rem;
  }

  .article-title {
    font-size: 2rem;
  }

  .article-content h2 {
    font-size: 1.7rem;
  }

  .article-content h3 {
    font-size: 1.3rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .sidebar-section {
    padding: 1.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .share-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .share-button {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .article-title {
    font-size: 1.75rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .article-content h3 {
    font-size: 1.2rem;
  }

  .main-content {
    padding: 1rem;
  }

  .sidebar-section {
    padding: 1rem;
  }
}
