/* Shared styles for every page. Page-specific rules stay in each page's own <style> block,
   which loads after this file and overrides it. */

:root {
  --primary-color: #4A90E2;
  --secondary-color: #2b2d42;
  --text-main: #2d3436;
  --text-muted: #636e72;
  --bg-light: #f8f9fa;
  --white: #ffffff;
  --accent-yellow: #fff9db;
  --accent-red: #fff5f5;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  margin: 0;
  background-color: var(--white);
}

.container {
  max-width: 750px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & footer */
header {
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.back-link {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
}

footer {
  padding: 50px 0;
  text-align: center;
  background: var(--bg-light);
  color: #777;
  font-size: 14px;
}

/* Play Store button */
.btn {
  display: inline-block;
  background: #ff002b;
  color: white;
  padding: 14px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: scale(1.03);
  background: #ff2e51;
}

/* Article hero: image with the title laid over it */
.hero-container {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  background: #000;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  width: 90%;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hero-text h1 {
  font-size: clamp(28px, 5vw, 40px);
  margin-bottom: 10px;
  line-height: 1.2;
}

/* Article body. :where() keeps these at element-level specificity so page rules can override them. */
article {
  padding: 30px 0 60px 0;
}

:where(article) h2 {
  font-size: 26px;
  margin-top: 40px;
  margin-bottom: 15px;
  color: var(--secondary-color);
  border-left: 5px solid var(--primary-color);
  padding-left: 15px;
  line-height: 1.2;
}

:where(article) h3 {
  font-size: 21px;
  margin-top: 25px;
  margin-bottom: 10px;
  color: var(--primary-color);
}

:where(article) p {
  margin-bottom: 16px;
}

:where(article) ul {
  margin-bottom: 20px;
  padding-left: 20px;
}

:where(article) li {
  margin-bottom: 8px;
}

hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 40px 0;
}

.updated {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px 0;
}

.photo-credit {
  font-size: 13px;
  color: var(--text-muted);
  margin: -12px 0 20px 0;
}

.photo-credit a {
  color: var(--text-muted);
}

/* A content image with a caption or photo credit underneath */
.photo {
  margin: 15px 0 25px 0;
}

.photo .content-img {
  margin: 0;
}

.photo figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.photo figcaption a {
  color: var(--text-muted);
}

.content-img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin: 15px 0 25px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Callout boxes */
.tip-box,
.warning-box,
.phrase-card {
  padding: 25px;
  border-radius: 12px;
}

.tip-box {
  background: var(--accent-yellow);
  border: 1px solid #f1e4a0;
  margin: 25px 0;
}

.warning-box {
  background: var(--accent-red);
  border: 1px solid #ffc9c9;
  margin: 25px 0;
}

.phrase-card {
  background: var(--bg-light);
  border: 1px solid #eee;
  margin: 15px 0 25px 0;
}

.phrase-card > *:first-child,
.tip-box > *:first-child,
.warning-box > *:first-child {
  margin-top: 0 !important;
}

.tip-box h2 {
  font-size: 22px;
  border: none;
  padding: 0;
  margin: 0 0 10px 0;
}

/* Japanese phrases: kana/kanji, then romaji, then translation */
.jp-text {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: #000;
  margin: 5px 0;
  line-height: 1.3;
}

.romaji {
  color: var(--text-muted);
  font-style: italic;
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
}

.translation {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 18px;
}

/* App download card */
.app-card {
  background: linear-gradient(145deg, #2b2d42, #1a1a1a);
  color: #ffffff;
  padding: 40px 30px;
  border-radius: 20px;
  margin-top: 50px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-card h2 {
  color: #ffffff;
  border: none;
  padding: 0;
  margin: 0 0 10px 0;
  font-size: 28px;
}

.app-card p {
  color: #f0f0f0;
  font-size: 18px;
  max-width: 500px;
  margin: 0 auto 20px auto;
}
