/* kaffr.app / kaffr.hu — Material Design 3 Adaptive Base & Layout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--md3-surface);
  color: var(--md3-on-surface);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--md3-surface);
  color: var(--md3-on-surface);
  overflow-x: clip;
  max-width: 100%;
  padding-bottom: 76px; /* room for mobile bottom navigation bar */
}

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

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

h1, h2, h3, h4 {
  margin: 0 0 0.4rem 0;
  line-height: 1.25;
  color: var(--md3-on-surface);
  overflow-wrap: anywhere;
}

p {
  margin: 0 0 0.75rem 0;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* Adaptive App Shell (Mobile single column -> Tablet/Desktop Navigation Rail + Main Area) */
.md3-app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  background-color: var(--md3-surface);
}

.md3-main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.md3-page-body {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 14px 14px 28px;
}

@media (min-width: 768px) {
  .md3-page-body {
    padding: 20px 24px 48px;
  }
}

body:has(#cookie-consent-banner:not([hidden])) .md3-page-body {
  padding-bottom: 150px;
}

/* 3-Column Content + Right Widgets layout on Desktop */
.md3-timeline-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (min-width: 1024px) {
  .md3-timeline-workspace {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 22px;
  }
}

/* Feed Cards Stream: Always single-column (mobile, tablet, and desktop) */
.md3-feed-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

/* Legacy helpers kept for subpages (catalog_list, detail, submit, privacy, legal) */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.desktop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.desktop-grid > *,
.cards-grid > * {
  min-width: 0;
}

@media (min-width: 960px) {
  .desktop-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
}

.cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

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

@media (min-width: 1024px) {
  .cards-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
