/*
Theme Name: Online Language Guide
Theme URI: https://online-language-guide.com
Author: Online Language Guide
Description: オンライン外国語学習完全ガイド のデザインをそのまま再現したカスタムテーマ。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: onlinelang
*/

:root {
  --main: #4A7C59;
  --sub: #7FA98E;
  --accent: #E0824D;
  --bg: #FAF6F0;
  --card: #FFFFFF;
  --panel: #F2EEE6;
  --text: #3A3835;
  --border: #E5DFD3;
  --white: #FFFFFF;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

ul {
  margin: 0;
  padding: 0;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header: logo + a single menu toggle at every breakpoint (nav lives in the
   slide-down panel), instead of a row of text links competing for space. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 246, 240, 0.94);
  backdrop-filter: blur(8px);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.brand-name {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-name__suffix {
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--main);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

/* Keep the centered wordmark clear of the hamburger button on narrow screens. */
@media (max-width: 640px) {
  .brand-name {
    font-size: 1.2rem;
  }

  .brand-name__suffix {
    font-size: 0.68rem;
  }
}

.nav-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--main);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
  list-style: none;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 4px 0 18px;
}

.site-nav.is-open {
  display: flex;
}

.site-nav a {
  display: block;
  padding: 10px 0;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--main);
}

main {
  padding-bottom: 48px;
}

/* Section rhythm shared across the whole site. */
.section {
  margin-top: 56px;
}

/* Featured picks read as a distinct editorial module — a tinted panel —
   so the plain "Latest" grid right below it doesn't blend into the same shape. */
.section--featured {
  padding: 28px 20px;
  background: var(--panel);
  border-radius: 12px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--text);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--sub);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Fading slideshow of up to 5 featured posts — each slide is an image with
   its category and title overlaid, cross-fading into the next automatically. */
.hero-post-section {
  margin: 28px 0 0;
}

.hero-slideshow {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.hero-post {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-post.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-post__media {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-post__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-post__category {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  padding: 5px 12px;
  background: var(--main);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-post__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 20px 18px 20px;
  background: linear-gradient(to top, rgba(58, 56, 53, 0.82) 0%, rgba(58, 56, 53, 0) 100%);
}

.hero-post__body h1 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--white);
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.hero-dots .dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
}

.hero-dots .dot.is-active {
  background: var(--main);
}

/* Category pills: one horizontal, swipeable nav used everywhere a category
   list would otherwise sit in a sidebar. */
.filter-list {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-list::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  color: rgba(58, 56, 53, 0.6);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a.filter-chip:hover {
  color: var(--text);
}

.filter-chip.is-active {
  color: var(--main);
  border-bottom-color: var(--main);
}

/* Article grid: image-up-top cards, one column on phones, more columns as
   the viewport grows. This is the one card style used everywhere (home,
   article list, category pages, related/same-category sections). */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.article-card {
  display: block;
}

.article-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.article-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-card__media img {
  transform: scale(1.03);
}

/* Homepage "latest articles" grid: sourced from 16:9 eyecatch images, so its
   cards use that ratio instead of the sitewide 4:3 default above. */
.article-grid--latest .article-card__media {
  aspect-ratio: 16 / 9;
}

/* Category label / tags sit over the top-left corner of the photo. */
.article-card__category {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  padding: 4px 10px;
  background: var(--main);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Title sits on a gradient scrim fading up from the bottom of the photo. */
.article-card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 16px 12px 12px;
  background: linear-gradient(to top, rgba(58, 56, 53, 0.82) 0%, rgba(58, 56, 53, 0) 100%);
}

.article-card__overlay h2,
.article-card__overlay h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--white);
}

.article-card:hover .article-card__overlay h2,
.article-card:hover .article-card__overlay h3 {
  text-decoration: underline;
}

/* Horizontal-scroll variant used for the "語学学習を前に進める記事" row:
   five cards visible across on desktop, swipeable everywhere else. */
.article-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.article-carousel::-webkit-scrollbar {
  display: none;
}

.article-carousel .article-card {
  flex: 0 0 72vw;
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .article-carousel .article-card {
    flex-basis: 42vw;
  }
}

@media (min-width: 1024px) {
  .article-carousel .article-card {
    flex-basis: 230px;
  }
}

/* Featured picks: a visibly different module (compact rows on a tinted
   panel, no photo overlay) so it doesn't read as just another article card. */
.featured-list {
  display: grid;
  gap: 4px;
  background: var(--panel);
  padding: 18px;
}

.featured-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.featured-item__media {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
}

.featured-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-item h3 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.2s ease;
}

.featured-item:hover h3 {
  color: var(--main);
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  color: var(--main);
  font-weight: 700;
}

.view-all-link:hover {
  color: var(--text);
}

.load-more-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 32px;
  padding: 14px 18px;
  border: 0;
  background: var(--main);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.load-more-btn:hover {
  opacity: 0.92;
}

.is-hidden {
  display: none;
}

/* PR / ad slots: kept as the same functional units, just no longer pinned
   to a persistent sidebar — they sit inline in the flow instead. */
.pr-slot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: var(--panel);
  color: rgba(58, 56, 53, 0.5);
  font-size: 0.85rem;
  font-weight: 700;
}

.pr-slot--inline {
  margin: 4px 0 28px;
}

/* Homepage "latest articles" variant: one grid cell instead of a full-width
   divider, sized to match .article-card via the same 16:9 ratio. */
.pr-slot--card {
  grid-column: auto;
  aspect-ratio: 16 / 9;
}

.pr-slot__badge {
  display: inline-flex;
  padding: 3px 10px;
  background: var(--border);
  color: rgba(58, 56, 53, 0.6);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.ad-section {
  margin-top: 56px;
}

.ad-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.banner-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 12px;
  background: var(--panel);
  color: rgba(58, 56, 53, 0.45);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}

.banner-slot--small {
  aspect-ratio: 3 / 1;
  font-size: 0.78rem;
}

/* Page intro used on the articles index and category archives. */
.page-shell {
  padding-top: 28px;
}

.page-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  color: rgba(58, 56, 53, 0.6);
  font-size: 0.88rem;
}

.page-breadcrumbs a {
  color: var(--sub);
  font-weight: 700;
}

.category-hero {
  margin-bottom: 32px;
}

.category-hero__title {
  margin: 0 0 14px;
  font-size: 1.7rem;
  line-height: 1.45;
  color: var(--text);
}

.category-hero__description {
  margin: 0;
  color: rgba(58, 56, 53, 0.72);
}

.page-toolbar {
  margin-bottom: 28px;
}

/* Single-post (entry) page: one column top to bottom, no persistent sidebar
   next to the article body — the sidebar's contents move below the content
   instead, which is also what phones need anyway. */
.entry-hero {
  padding-top: 24px;
  margin-bottom: 28px;
}

.entry-hero__title {
  margin: 0 0 16px;
  font-size: 1.7rem;
  line-height: 1.45;
  color: var(--text);
}

.entry-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
}

.entry-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: var(--main);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
}

.entry-date {
  color: rgba(58, 56, 53, 0.6);
  font-size: 0.86rem;
  font-weight: 600;
}

.entry-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 24px;
}

.entry-content h2 {
  margin: 40px 0 14px;
  color: var(--text);
  font-size: 1.2rem;
}

.entry-content h2:first-child {
  margin-top: 0;
}

.entry-content p {
  margin: 0 0 20px;
  color: rgba(58, 56, 53, 0.78);
  line-height: 1.9;
}

.entry-content h3 {
  margin: 36px 0 12px;
  padding-left: 14px;
  border-left: 4px solid var(--main);
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
}

.entry-content h4 {
  margin: 28px 0 10px;
  color: var(--main);
  font-size: 0.95rem;
  font-weight: 700;
}

.entry-content ul,
.entry-content ol,
.entry-list {
  margin: 0 0 24px;
  padding-left: 22px;
}

.entry-content li,
.entry-list li {
  margin-bottom: 8px;
  color: rgba(58, 56, 53, 0.78);
  line-height: 1.85;
}

.entry-content ul li::marker,
.entry-list li::marker {
  color: var(--main);
}

.entry-content ol li::marker {
  color: var(--main);
  font-weight: 700;
}

.entry-content table {
  width: 100%;
  margin: 0 0 28px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.entry-content th,
.entry-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: rgba(58, 56, 53, 0.85);
}

.entry-content th {
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

.entry-content tr:last-child th,
.entry-content tr:last-child td {
  border-bottom: none;
}

/* A short example phrase + translation, styled like a speech bubble so it
   reads as something to say out loud rather than more body copy. */
.one-point-lesson {
  margin: 56px 0 28px;
}

.one-point-lesson__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--main);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.one-point-lesson__label::before,
.one-point-lesson__label::after {
  color: var(--accent);
  font-weight: 700;
}

.one-point-lesson__label::before {
  content: "＼";
}

.one-point-lesson__label::after {
  content: "／";
}

.one-point-lesson__bubble {
  position: relative;
  background: var(--panel);
  border-radius: 18px;
  padding: 20px 22px;
}

.one-point-lesson__bubble::before {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -11px;
  width: 22px;
  height: 22px;
  background: var(--panel);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  border-bottom-left-radius: 4px;
}

.one-point-lesson__example {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(74, 124, 89, 0.1);
}

.one-point-lesson .one-point-lesson__phrase {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.6;
}

.one-point-lesson__reading {
  display: block;
  margin-top: 4px;
  color: rgba(58, 56, 53, 0.6);
  font-size: 0.85rem;
  font-weight: 500;
}

.one-point-lesson .one-point-lesson__translation {
  margin: 0;
  color: rgba(58, 56, 53, 0.72);
  font-size: 0.92rem;
  line-height: 1.7;
}

.one-point-lesson__note {
  margin-top: 14px;
}

.one-point-lesson .one-point-lesson__note-title {
  margin: 0 0 1px;
  color: var(--main);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.one-point-lesson .one-point-lesson__note-list {
  margin: 0;
  padding-left: 18px;
}

.one-point-lesson__note-list li {
  margin-bottom: 6px;
  color: rgba(58, 56, 53, 0.78);
  font-size: 0.9rem;
  line-height: 1.75;
}

.one-point-lesson__note-list li:last-child {
  margin-bottom: 0;
}

.one-point-lesson__note-list strong {
  color: var(--text);
}

.related-section,
.same-category-section {
  margin-top: 56px;
}

/* Everything that used to be the sticky right rail — theme list, featured
   picks, ad slots — now reads as calm, full-width sections after the
   article instead of racing the content down the page. */
.entry-extra {
  margin-top: 56px;
  display: grid;
  gap: 48px;
}

.entry-extra .section-heading h2 {
  font-size: 1.1rem;
}

@media (min-width: 640px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-post__body h1 {
    font-size: 1.8rem;
  }
}

@media (min-width: 1024px) {
  .header-inner {
    padding: 18px 0;
  }

  .brand-name {
    font-size: 1.9rem;
  }

  .section--featured {
    padding: 40px;
  }

  .site-nav {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin: 0;
    padding: 0;
  }

  .site-nav a {
    padding: 6px 0;
  }

  .nav-toggle {
    display: none;
  }

  .hero-slideshow {
    aspect-ratio: 21 / 9;
  }

  .hero-post__body {
    padding: 32px 32px 28px;
  }

  .hero-post__body h1 {
    font-size: 2.1rem;
  }

  .article-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-hero__title,
  .entry-hero__title {
    font-size: 2.15rem;
  }

  .entry-cover {
    aspect-ratio: 21 / 9;
  }
}

.site-footer {
  padding: 0;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 22px 24px;
  background: var(--text);
  color: var(--white);
  text-align: center;
}

.footer-copy {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
