.page-materials {
  margin: 0;
  height: 100vh;
  background: #faf7f4;
  font-family: Helvetica, Arial, sans-serif;
  overflow: hidden;
}

.materials-shell {
  height: 100vh;
  position: relative;
}

.materials-background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
  pointer-events: none;
}

.materials-background-mobile {
  display: none;
}

.materials-background-desktop {
  display: block;
}

.materials-content {
  position: relative;
  z-index: 2;
  height: 100vh;
  overflow: hidden;
}

/* MENÚ */

.materials-nav {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2rem;
  font-size: 0.95rem;
  z-index: 5;
}

.materials-nav a,
.materials-footer a {
  color: rgba(47, 42, 38, 0.72);
  text-decoration: none;
}

/* PORTADES */

.materials-home {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.materials-home h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 3.2rem;
  font-weight: 350;
  color: #28435e;
  margin: 0 0 2.4rem;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.category-link {
  font-size: 1.35rem;
  color: rgba(47, 42, 38, 0.82);
  text-decoration: none;
}

/* SUBPÀGINES */

.materials-list-page {
  width: min(760px, 82vw);
  margin: 0 auto;
  padding-top: 72px;
  height: calc(100vh - 72px);
  box-sizing: border-box;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: rgba(47, 42, 38, 0.65);
  text-decoration: none;
  font-size: 0.95rem;
}

.materials-list-page h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.9rem;
  font-weight: 350;
  color: #28435e;
  margin: 0 0 28px;
}

.materials-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  padding-right: 10px;
  padding-bottom: 80px;
  box-sizing: border-box;
  margin: 0 auto;
}

/* TARGETES */

.material-item {
  width: 100%;
}

.material-card-link,
.media-card,
.doc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.74);
  border-radius: 10px;
  padding: 9px 11px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
  width: 100%;
  box-sizing: border-box;
}

.material-card-link:hover {
  background: rgba(255,255,255,0.9);
}

.media-icon-wrap {
  width: 24px;
  height: 24px;
  min-width: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.media-icon-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.media-title,
.material-title,
.doc-title {
  font-size: 14px;
  line-height: 1.25;
  color: #111827;
  text-decoration: none;
  word-break: break-word;
}

.doc-icon-wrap {
  width: 34px;
  min-width: 34px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.doc-icon-pdf {
  color: #b42318;
  background: rgba(180,35,24,0.10);
}

.doc-icon-img {
  color: #35556f;
  background: rgba(53,85,111,0.12);
}

.doc-meta,
.material-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.material-desc {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: #6b7280;
}

.video-file-card {
  background: rgba(255,255,255,0.74);
}

.video-file-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: rgba(47,42,38,0.72);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* FOOTER */

.materials-footer {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  white-space: nowrap;
  font-size: 0.85rem;
  color: rgba(47, 42, 38, 0.55);
  z-index: 5;
}

.materials-empty-message {
  max-width: 560px;
  margin: 0 auto;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.55;
  color: #28435e;
}

/* ==========================
   MÒBIL
========================== */

@media (max-width:700px){

  .page-materials,
  .materials-shell,
  .materials-content {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }

  .materials-background {
    width: 100vw;
    height: 100svh;
    object-fit: cover;
    object-position: center top;
    transform: none;
  }

  .materials-background-desktop {
    display: none;
  }

  .materials-background-mobile {
    display: block;
  }
  .materials-home-split {
  top: 43%;
}

.materials-home-left {
  margin-top: 0;
}

.materials-home-left h1 {
  line-height: 1.05;
  margin-bottom: 0.65rem;
}

.materials-home-left .materials-intro {
  margin-bottom: 1.45rem;
}

.materials-home-left .category-list {
  gap: 0.95rem;
}

.communication-panel{
    margin-top:2rem;
    width:92%;
    max-width:420px;
}

.communication-image,
.communication-video,
.communication-embed{
    width:100%;
    max-height:35vh;
}
}
