/* Materiály - gated content section (/materialy).
   Feed + post layout modelled on a creator-post feed (author row, title,
   quoted perex, media, "zobrazit více"), in the Tak Trochen design system.
   Tokens come from design-system.css. */

/* The feed page reuses the Blog layout and card styles from styles.css:
   .hero/.hero-inner, .blog-toolbar, .blog-grid, .filter-tab, .blog-post,
   .post-meta, .post-title, .post-description, .post-stats, .post-category.
   The rules below only cover what Materiály does differently: two columns,
   and the media sits after the text instead of as a thumbnail on top. */

/* post detail column */
.mat-layout { max-width: 720px; margin: 0 auto; padding: 0 16px 4rem; }


.mat-feed { margin-bottom: 0; }
@media (min-width: 769px) {
  .mat-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mat-feed > .mat-status { grid-column: 1 / -1; }
.mat-card { min-width: 0; }
/* title first, then the Bára / date / type line */
.mat-card .post-title { margin-bottom: .5rem; }
.mat-card .post-title a { color: inherit; text-decoration: none; }
.mat-card .post-title a:hover { color: var(--accent); }
/* spare height goes above the footer, not between perex and media */
.mat-card .post-description { flex: none; margin-bottom: .5rem; }
.mat-card .post-stats { gap: .75rem; }
.mat-tags { display: flex; gap: .5rem; flex-wrap: wrap; min-width: 0; }

/* Materiály categories, coloured like the Blog's category pills */
.mat-cat-vyukova-videa { background: #3498db; }
.mat-cat-bonusove-epizody { background: #8e44ad; }
.mat-cat-tipy-na-uceni { background: #e67e22; }
.mat-cat-vyslovnost { background: #16a085; }
/* (Cvičení k veřejným podcastům and anything new keep the default accent) */

.mat-more { color: var(--tt-orange); font-size: var(--tt-text-sm); font-weight: 600; text-decoration: none; }
.mat-more:hover { text-decoration: underline; }

.mat-cover { position: relative; display: block; margin: 1rem 0 0; border-radius: 12px; overflow: hidden; background: var(--tt-border); }
.mat-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.mat-cover__play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(30, 36, 43, .78); display: grid; place-items: center;
}
.mat-cover__play::after { content: ""; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; margin-left: 5px; }
.mat-cover__duration {
  position: absolute; right: .5rem; bottom: .5rem; background: rgba(30, 36, 43, .82); color: #fff;
  border-radius: 6px; padding: .1rem .45rem; font-size: var(--tt-text-xs); font-weight: 600;
}
.mat-card__foot { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.mat-tag { color: var(--text-light); font-size: var(--tt-text-sm); }
.mat-tag::before { content: "#"; }

.mat-status { text-align: center; color: var(--tt-muted); padding: 2rem 0; }
.mat-load-more { display: block; margin: 1.5rem auto 0; }
.mat-load-more[aria-disabled="true"] { opacity: .6; cursor: progress; }

/* post detail */
.mat-back { display: inline-flex; gap: .4rem; color: var(--tt-orange); font-weight: 600; text-decoration: none; margin: 2rem 0 1rem; }
.mat-post {
  background: var(--tt-card); border: 1px solid var(--tt-border); border-radius: 20px; padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);   /* same card as the feed (.blog-post) */
}
.mat-post h1 { font-size: var(--tt-text-3xl); line-height: var(--tt-leading-tight); color: var(--tt-dark); margin: 0 0 .75rem; }
.mat-post > .post-meta { margin-bottom: 1.25rem; }
.mat-card__foot .post-category { margin-right: .25rem; }
.mat-post .mat-cover img { aspect-ratio: auto; max-height: 420px; }
.mat-body { color: var(--tt-text); font-size: var(--tt-text-base); line-height: var(--tt-leading-relaxed); overflow-wrap: anywhere; }
.mat-body h2, .mat-body h3 { color: var(--tt-dark); line-height: var(--tt-leading-snug); margin: 1.75rem 0 .75rem; }
.mat-body img { max-width: 100%; height: auto; border-radius: 12px; }
.mat-body figure { margin: 1.25rem 0; }
.mat-body blockquote { border-left: 4px solid var(--tt-yellow); background: var(--tt-yellow-light); margin: 1.25rem 0; padding: .75rem 1rem; border-radius: 0 12px 12px 0; }
.mat-body audio { width: 100%; margin: 1rem 0; }
.mat-body iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; margin: 1rem 0; }
/* Spotify episode players have a fixed layout height, not a video ratio */
.mat-body iframe[src*="open.spotify.com"] { aspect-ratio: auto; height: 352px; }
/* ...except Spotify video episodes, which are 16:9 like any other video */
.mat-body iframe[src*="open.spotify.com"][src*="/video"] { aspect-ratio: 16 / 9; height: auto; }
.mat-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.mat-body td, .mat-body th { border: 1px solid var(--tt-border); padding: .4rem .6rem; }
.mat-attachments { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .5rem; }
.mat-attachments a {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 1px solid var(--tt-border);
  border-radius: 12px; text-decoration: none; color: var(--tt-dark); background: var(--tt-bg);
}
.mat-attachments a::before { content: "📎"; }
.mat-attachments a:hover { border-color: var(--tt-orange); }
.mat-attachments small { color: var(--tt-muted); margin-left: auto; white-space: nowrap; }
.mat-video-pending {
  display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 12px; margin: 1rem 0;
  background: var(--tt-dark); color: #fff; text-align: center; padding: 1rem; font-weight: 600;
}
.mat-poll { border: 1px solid var(--tt-border); border-radius: 12px; padding: 1rem; margin: 1.25rem 0; }
.mat-poll ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.mat-device { text-align: center; margin-top: 2rem; }
.mat-device button { background: none; border: 0; color: var(--tt-muted); font: inherit; font-size: var(--tt-text-xs); text-decoration: underline; cursor: pointer; }

/* gate */
.mat-gate { max-width: 480px; margin: 3rem auto 4rem; padding: 0 16px; }
.mat-gate__card {
  background: var(--tt-card); border: 1px solid var(--tt-border); border-radius: 20px; padding: 2rem 1.5rem;
  box-shadow: 0 10px 30px rgba(30, 36, 43, .06); position: relative; overflow: hidden;
}
.mat-gate__card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--tt-orange); }
.mat-gate__icon { font-size: 2.25rem; }
.mat-gate h1:focus { outline: none; } /* focused by script on state change, for screen readers */
.mat-gate h1 { font-size: var(--tt-text-3xl); color: var(--tt-dark); margin: .5rem 0 .75rem; line-height: var(--tt-leading-tight); }
.mat-gate p { color: var(--tt-text); line-height: var(--tt-leading-normal); }
.mat-gate form { display: grid; gap: .75rem; margin-top: 1.25rem; }
.mat-gate label { font-weight: 600; color: var(--tt-dark); font-size: var(--tt-text-sm); }
.mat-gate .tt-input { width: 100%; }
.mat-gate__or { display: flex; align-items: center; gap: .75rem; color: var(--tt-muted); font-size: var(--tt-text-xs); margin: 1.25rem 0; }
.mat-gate__or::before, .mat-gate__or::after { content: ""; flex: 1; height: 1px; background: var(--tt-border); }
.mat-google {
  display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  border: 1px solid var(--tt-border-strong); border-radius: 999px; padding: .75rem 1rem;
  color: var(--tt-dark); background: #fff; text-decoration: none; font-weight: 600;
}
.mat-google:hover { border-color: var(--tt-dark); }
.mat-google svg { width: 18px; height: 18px; }
.mat-gate__error { color: #b42318; font-size: var(--tt-text-sm); min-height: 1.25rem; margin: 0; }
.mat-gate__fine { color: var(--tt-muted); font-size: var(--tt-text-xs); margin-top: 1.25rem; }
.mat-gate__fine a { color: inherit; text-decoration: underline; }
.mat-gate [hidden] { display: none !important; }

@media (max-width: 480px) {
  .mat-post { padding: 1rem; }
}

/* Hero: one column (the Blog's two-column hero leaves half the width, which
   pushes the 📚 onto its own line above "Samostudium"), and compact spacing so
   the shared hero + section paddings don't stack up to ~160px between the
   intro text and the chips (~100px on phones). */
.mat-page .hero-inner { grid-template-columns: 1fr; }
.mat-page .hero { padding: clamp(1.75rem, 4vw, 3.5rem) 0 clamp(1.5rem, 2.5vw, 2.25rem); }
.mat-page .hero h1 { margin-bottom: 12px; }
.mat-page .hero .lead { margin-bottom: 0; max-width: 40rem; }
.mat-page .section-tight { padding-top: clamp(1.25rem, 2.5vw, 2rem); }
@media (max-width: 768px) {
  .mat-toolbar { gap: 16px; margin-bottom: 24px; }
}

/* Touch screens swipe the chips; the scrollbar is only for mouse users */
@media (hover: none) {
  .mat-chips { scrollbar-width: none; }
  .mat-chips::-webkit-scrollbar { display: none; }
}
