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

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: "Space Grotesk", sans-serif;
}

/* ── Base ── */
body {
  background-color: white;
  color: #222;
  font-family: "Times New Roman", Times, serif;
  padding: 16px;
  line-height: 1.4;
}

@media (min-width: 768px) {
  body { padding: 32px; }
}

.max-w-6xl {
  max-width: 1152px;
  margin-left: auto;
  margin-right: auto;
}

a {
  color: #DC143C;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 16px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  header {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

h1 {
  font-size: 1.875rem;
  font-weight: bold;
  margin: 0;
  cursor: pointer;
}
h1:hover { color: #DC143C; }

.tagline {
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

/* ── Language switcher ── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-switcher__item {
  font-size: 1.1rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.4;
  transition: opacity 0.15s;
  cursor: pointer;
}

.lang-switcher__item:hover {
  opacity: 1;
}

.lang-switcher__item--active {
  opacity: 1;
  cursor: default;
}

.separator { color: #d1d5db; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box input {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  font-size: 0.875rem;
  width: 160px;
  font-family: inherit;
}
@media (min-width: 768px) {
  .search-box input { width: 256px; }
}

/* ── Main ── */
main { padding-bottom: 0; }

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 32px;
  row-gap: 48px;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
/* ── Category sections ── */
section h3 {
  background-color: #f2f2f2;
  border-top: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  padding: 4px 8px;
  font-size: 0.875rem;
  font-weight: bold;
  margin: 0 0 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
section h3 a {
  color: inherit;
  text-decoration: none;
}
section h3 a:hover {
  color: #DC143C;
  text-decoration: none;
}

.count {
  font-size: 10px;
  color: #9ca3af;
  font-weight: normal;
  text-transform: uppercase;
}

ul {
  list-style: none;
  padding: 0 8px;
  margin: 0;
}
li { margin-bottom: 8px; }

.item-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
}
.item-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.25;
  margin-top: 2px;
}

.empty-listing {
  font-size: 11px;
  color: #9ca3af;
  font-style: italic;
}

.view-all {
  display: table;
  margin-left: auto;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  text-decoration: none;
}
.view-all:hover {
  color: #111827;
}

/* ── Goals ── */
.goals-section {
  margin-bottom: 48px;
}

.section-heading {
  background: none;
  border: none;
  font-size: 1.125rem;
  font-weight: bold;
  padding: 24px 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.goals-heading {
  background: none;
  border: none;
  font-size: 1.125rem;
  font-weight: bold;
  margin-bottom: 20px;
  display: block;
  padding: 0;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}

@media (min-width: 768px) {
  .goals-grid { grid-template-columns: repeat(5, 1fr); }
}

.goal-card h4 {
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.goal-card h4 a {
  color: inherit;
  text-decoration: none;
}

.goal-card h4 a:hover {
  color: #374151;
}

.goal-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.goal-card li {
  font-size: 0.8rem;
  margin-bottom: 4px;
  line-height: 1.3;
}

/* ── Personals ── */
.personals {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid #d1d5db;
}
.personals h3 {
  background: none;
  border: none;
  font-size: 1.125rem;
  margin-bottom: 24px;
  text-align: center;
  display: block;
}
@media (min-width: 768px) {
  .personals h3 { text-align: left; }
}

.personals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .personals-grid { grid-template-columns: repeat(3, 1fr); }
}

.personal-ad {
  padding: 16px;
  background-color: #fff8e7;
  border: 1px solid #ffe0b2;
  font-size: 12px;
}
.personal-ad p { margin: 0 0 4px 0; }
.personal-ad p:first-child {
  font-weight: bold;
  text-decoration: underline;
}

/* ── Footer ── */
footer {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid #d1d5db;
  font-size: 10px;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
footer a { color: #6b7280; }
footer a:hover { color: #DC143C; text-decoration: underline; }

.polish-red {
  color: #DC143C;
  font-weight: bold;
}

/* ── List pages (category subpages) ── */
.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: #9ca3af;
  text-decoration: none;
  margin-bottom: 8px;
}
.back-link:hover {
  color: #374151;
}

.page-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #d1d5db;
}
.page-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 0.2rem;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}
.page-header p {
  font-size: 0.875rem;
  color: #6b7280;
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.resource-item {
  padding: 0.7rem 0;
  border-bottom: 1px solid #d1d5db;
}
.resource-item:first-child { border-top: 1px solid #d1d5db; }
.resource-item__name { font-size: 1rem; display: inline; }
.resource-item__name a { font-weight: 600; color: #DC143C; }
.resource-item__name a:visited { color: #c47a8a; }
.resource-item__name a:hover { text-decoration: underline; }
.resource-item__desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.45;
  margin-top: 0.2rem;
}
.resource-item__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}
.tag {
  font-size: 0.72rem;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}
.tag--free { color: #2a6b2a; border-color: #b3d9b3; }
.tag--featured { color: #DC143C; border-color: #f9c0c0; }

/* ── Meme pages ── */
.meme-list { list-style: none; padding: 0; }
.meme-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #d1d5db;
}
.meme-item:first-child { border-top: 1px solid #d1d5db; }
.meme-item__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.meme-item__image { margin: 0.75rem 0; max-width: 480px; }
.meme-item h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-bottom: 0.3rem;
  margin-top: 0.75rem;
}
.meme-item p { font-size: 0.9rem; color: #6b7280; line-height: 1.55; }
.meme-item ul {
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.75;
}

/* ── Container for list pages ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

/* ── Roadmap ── */
.roadmap-timeline {
  position: relative;
  padding: 0.5rem 0 2rem 3rem;
}
.roadmap-timeline::before {
  content: '';
  position: absolute;
  left: 0.9rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #DC143C 0%, #e5e7eb 100%);
}
.roadmap-stage {
  position: relative;
  margin-bottom: 2.5rem;
}
.stage-dot {
  position: absolute;
  left: -2.6rem;
  top: 0.35rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #DC143C;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.25);
  z-index: 1;
}
.stage-dot--end {
  background: #e5e7eb;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.stage-content {
  padding-bottom: 0.25rem;
}
.stage-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.stage-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.stage-level-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #DC143C;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.stage-description {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 1rem;
  line-height: 1.55;
}
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.topic-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.topic-card summary {
  padding: 0.7rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
}
.topic-card summary::-webkit-details-marker { display: none; }
.topic-card summary:hover { background: #fafafa; }
.topic-card[open] > summary { border-bottom: 1px solid #e5e7eb; }
.topic-name {
  font-size: 0.95rem;
}
.arrow {
  font-size: 0.65rem;
  color: #9ca3af;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.topic-card[open] .arrow { transform: rotate(90deg); }
.topic-body {
  padding: 1rem;
  background: #fafafa;
}
.topic-body > p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.6;
}
.resources-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin: 0 0 0.5rem;
}
.resource-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.resource-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #222;
  text-decoration: none;
  font-size: 0.9rem;
}
.resource-links a:hover { color: #DC143C; }
.resource-links a:hover .res-name { text-decoration: underline; }
.res-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: #e5e7eb;
  color: #555;
  white-space: nowrap;
  flex-shrink: 0;
}
.free-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  white-space: nowrap;
  flex-shrink: 0;
}
.roadmap-end {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.25rem;
}
.roadmap-end p {
  font-size: 0.85rem;
  color: #9ca3af;
  margin: 0;
  font-style: italic;
}
@media (max-width: 640px) {
  .roadmap-timeline { padding-left: 2rem; }
  .roadmap-timeline::before { left: 0.6rem; }
  .stage-dot { left: -1.85rem; }
  .stage-header { flex-wrap: wrap; }
}

/* ── Song pages ── */
.song-video-wrap {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  margin: 1.25rem 0;
  background: #f3f4f6;
}
.song-video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.song-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.song-verse-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #d1d5db;
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f3f4f6;
}
.song-verse {
  margin-bottom: 1.5rem;
}
.song-verse__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-bottom: 0.3rem;
}
.song-verse__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.song-verse__polish {
  font-size: 0.9rem;
  color: #111827;
  line-height: 1.8;
  white-space: pre-line;
  font-style: italic;
}
.song-verse__english {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.8;
  white-space: pre-line;
}
@media (max-width: 640px) {
  .song-verse-header,
  .song-verse__cols { grid-template-columns: 1fr; }
  .song-verse-header span:last-child { display: none; }
}


/* ── Error notice box ── */
.error-notice {
  margin-top: 2rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #d1d5db;
  background: #f9fafb;
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.6;
}
.error-notice a {
  color: #374151;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.error-notice a:hover { color: #111827; }

/* Add page */
.add-page {
  max-width: 560px;
  margin: 4rem auto;
}
.add-page h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.add-intro {
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}
.add-methods {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.add-method {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}
.add-method-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.add-method-body p {
  color: #4b5563;
  line-height: 1.65;
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
}
.add-method-body a {
  font-size: 0.9rem;
  font-family: "Space Grotesk", sans-serif;
}

/* Audio player — idioms, proverbs, tongue twisters */
.audio-player {
  margin-bottom: 1.25rem;
}
.audio-player h4 {
  margin-bottom: 0.4rem;
}
.audio-player audio {
  width: 100%;
  max-width: 480px;
  display: block;
}
.not-found {
  padding: 5rem 1rem 6rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.not-found__code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  color: #DC143C;
  letter-spacing: -4px;
}
.not-found__polish {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: #222;
}
.not-found__gloss {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.25rem;
  margin-bottom: 2rem;
}
.not-found__message {
  font-size: 1rem;
  color: #444;
  margin-bottom: 2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 2rem;
}
.not-found__home {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: #DC143C;
  border: 1px solid #DC143C;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.not-found__home:hover {
  background: #DC143C;
  color: #fff;
  text-decoration: none;
}
