/* ============================================================
   MAT2020 Magazine — Modern Stylesheet
   MusicArTeam | Aggiornamento 2026
   ============================================================ */

/* === CSS Variables ======================================== */
:root {
  --gold:      #c9a84c;
  --gold-dark: #a07830;
  --dark:      #111111;
  --burgundy:  #6b2737;
  --bg:        #f5f0e8;
  --text:      #2d2d2d;
  --text-muted:#6a6058;
  --border:    #ddd0bf;
  --white:     #ffffff;
  --card-bg:   #ffffff;
  --max-w:     1200px;
  --shadow:    0 4px 18px rgba(0,0,0,0.12);
  --transition:.25s ease;
  --radius:    2px;
}

/* === Reset ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
img   { max-width: 100%; height: auto; display: block; }
ul    { list-style: none; }
a     { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-dark); }

/* === Body ================================================= */
body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: var(--bg);
  background-image: url('bg.jpg');
  background-repeat: repeat;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

/* === Container ============================================ */
.mat-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* === HEADER =============================================== */
.mat-header {
  background-color: var(--dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.mat-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mat-header__logos {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.mat-header__logos img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.mat-header__logos .logo-secondary {
  height: 52px;
}

/* === NAVIGATION =========================================== */
.mat-nav__list {
  display: flex;
  align-items: center;
  gap: 0;
}

.mat-nav__list a {
  display: block;
  padding: 10px 20px;
  color: #d5cfc6;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.mat-nav__list a:hover,
.mat-nav__list a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Blog link special */
.mat-nav__list .nav-blog a {
  color: var(--gold);
}
.mat-nav__list .nav-blog a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* Hamburger */
.mat-nav__toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.2);
  color: #d5cfc6;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.mat-nav__toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* === HERO SECTION ========================================= */
.mat-hero {
  padding: 70px 0 80px;
}

.mat-hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
}

.mat-hero__eyebrow {
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 14px;
}

.mat-hero__title {
  font-size: 3.2rem;
  line-height: 1.15;
  color: var(--dark);
  margin-bottom: 12px;
}

.mat-hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 32px;
  line-height: 1.5;
}

.mat-hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.mat-hero__cover {
  position: relative;
}

.mat-hero__cover a { display: block; }

.mat-hero__cover img {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
}
.mat-hero__cover img:hover { transform: translateY(-6px); }

/* === BUTTONS ============================================== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background-color: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}
.btn--primary:hover {
  background-color: transparent;
  color: var(--gold);
}

.btn--outline {
  background-color: transparent;
  color: var(--dark);
  border-color: var(--dark);
}
.btn--outline:hover {
  background-color: var(--dark);
  color: #fff;
}

.btn--outline-light {
  background-color: transparent;
  color: #e0d5c8;
  border-color: rgba(255,255,255,0.35);
}
.btn--outline-light:hover {
  background-color: rgba(255,255,255,0.1);
  border-color: var(--gold);
  color: var(--gold);
}

/* === SECTION HEADER ======================================= */
.mat-section-header {
  text-align: center;
  margin-bottom: 44px;
}

.mat-section-header__title {
  font-size: 2rem;
  color: var(--dark);
  position: relative;
  display: inline-block;
  padding-bottom: 16px;
}

.mat-section-header__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background-color: var(--gold);
}

.mat-section-header__sub {
  margin-top: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* === ISSUE CARDS ========================================== */
.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 22px;
}

.issue-card {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.issue-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.issue-card__cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2520, #1a1510);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative; /* needed for overlay */
}

/* Overlay "Sfoglia" — rende chiaro che è cliccabile */
.issue-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  pointer-events: none;
  z-index: 2;
}
.issue-card:hover .issue-card__overlay {
  background: rgba(0,0,0,0.6);
}
.issue-card__overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background-color: var(--gold);
  color: var(--dark);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 9px 18px;
  border-radius: 1px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.issue-card:hover .issue-card__overlay-btn {
  opacity: 1;
  transform: translateY(0);
}

.issue-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.issue-card:hover .issue-card__cover img { transform: scale(1.04); }

/* Placeholder cover */
.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(145deg, #1e1e1e, #111);
  padding: 20px;
}
.cover-placeholder img {
  width: 55%;
  opacity: 0.35;
}
.cover-placeholder span {
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  text-align: center;
}

.issue-card__info {
  padding: 12px 14px 14px;
  border-top: 2px solid var(--gold);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.issue-card__label {
  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.issue-card__title {
  font-size: 0.92rem;
  color: var(--dark);
  margin-top: 4px;
  line-height: 1.3;
  flex: 1;
}

.issue-tag {
  display: inline-block;
  background-color: var(--burgundy);
  color: #fff;
  font-size: 0.62rem;
  text-transform: uppercase;
  padding: 2px 7px;
  margin-top: 6px;
  font-family: Arial, sans-serif;
  letter-spacing: 0.05em;
  border-radius: 1px;
  width: fit-content;
}

/* === RECENT ISSUES SECTION ================================ */
.recent-section {
  padding: 70px 0;
  background-color: rgba(255,255,255,0.45);
  backdrop-filter: blur(2px);
}

.recent-section .section-cta {
  text-align: center;
  margin-top: 40px;
}

/* === BLOG SECTION ========================================= */
.blog-section {
  padding: 70px 0;
}

.blog-box {
  max-width: 720px;
  margin: 0 auto;
  background-color: var(--dark);
  padding: 55px 48px;
  text-align: center;
}

.blog-box .mat-section-header__title { color: #e8e0d5; }
.blog-box .mat-section-header__title::after { background-color: var(--gold); }
.blog-box .mat-section-header__sub { color: #9a8f85; }

.blog-box p {
  color: #9a8f85;
  font-style: italic;
  margin: 20px 0 34px;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* === ABOUT SECTION ======================================== */
.about-section {
  padding: 50px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.about-section p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.97rem;
}

/* === ARCHIVE PAGE ========================================= */
.page-hero {
  background-color: var(--dark);
  padding: 52px 0;
  text-align: center;
}

.page-hero__title {
  font-size: 2.6rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.page-hero__sub {
  color: #d4ccc4;
  font-style: italic;
  font-size: 1rem;
}

.archive-section { padding: 65px 0; }

.year-group { margin-bottom: 65px; }

.year-group:last-child { margin-bottom: 0; }

.year-title {
  font-size: 1.7rem;
  color: var(--dark);
  border-left: 4px solid var(--gold);
  padding-left: 16px;
  margin-bottom: 28px;
}

/* === FOOTER =============================================== */
.mat-footer {
  background-color: var(--dark);
  color: #7a7068;
  padding: 32px 0;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  border-top: 2px solid var(--gold);
}

.mat-footer .mat-container p { margin: 5px 0; }
.mat-footer a { color: var(--gold); }
.mat-footer a:hover { color: #fff; }

/* === PAGE TITLE (for issue pages) ========================= */
.mat-page-title {
  background-color: var(--dark);
  color: var(--gold);
  padding: 18px 24px;
  text-align: center;
  font-size: 1.4rem;
  border-bottom: 2px solid rgba(201,168,76,0.3);
}

/* === RESPONSIVE =========================================== */
@media (max-width: 960px) {
  .mat-hero__inner {
    grid-template-columns: 1fr 340px;
    gap: 40px;
  }
  .mat-hero__title { font-size: 2.6rem; }
}

@media (max-width: 768px) {
  /* Header stacks */
  .mat-header__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px;
    gap: 10px;
  }

  .mat-header__logos {
    justify-content: center;
    gap: 14px;
  }
  .mat-header__logos img      { height: 48px; }
  .mat-header__logos .logo-secondary { height: 38px; }

  /* Nav collapses */
  .mat-nav {
    position: relative;
  }
  .mat-nav__toggle { display: block; width: 100%; }

  .mat-nav__list {
    display: none;
    flex-direction: column;
    background-color: rgba(20,20,20,0.97);
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .mat-nav__list.is-open { display: flex; }
  .mat-nav__list a {
    padding: 13px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    border-left: none;
  }

  /* Hero stacks */
  .mat-hero { padding: 50px 0 60px; }
  .mat-hero__inner {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .mat-hero__cover { order: -1; }
  .mat-hero__cover img { max-width: 260px; }
  .mat-hero__title { font-size: 2.2rem; }
  .mat-hero__actions { justify-content: center; }

  /* Blog box */
  .blog-box { padding: 40px 28px; }

  /* Archive */
  .page-hero__title { font-size: 2rem; }
  .year-title { font-size: 1.4rem; }

  /* Issue cards — slightly wider on mobile */
  .issues-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .mat-hero__title { font-size: 1.8rem; }
  .issues-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .mat-section-header__title { font-size: 1.6rem; }
  .blog-box { padding: 30px 18px; }
}

/* === PDF MAGAZINE VIEWER MODAL ============================ */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.93);
  padding: 16px;
  animation: modalFadeIn 0.2s ease;
}

.pdf-modal[hidden] {
  display: none !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pdf-modal__container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  height: calc(100vh - 32px);
  max-height: 960px;
  background: #1c1c1c;
  border-top: 3px solid var(--gold);
  box-shadow: 0 0 100px rgba(0,0,0,0.9), 0 0 0 1px rgba(201,168,76,0.15);
  overflow: hidden;
  animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.pdf-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  background: #111;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  flex-shrink: 0;
  gap: 12px;
}

.pdf-modal__title {
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pdf-modal__open {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 2px;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
}
.pdf-modal__open:hover {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold);
  color: #fff;
}

.pdf-modal__close {
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: #aaa;
  font-size: 1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: all var(--transition);
  line-height: 1;
}
.pdf-modal__close:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

.pdf-modal__frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
  display: block;
}

/* Responsive modal */
@media (max-width: 600px) {
  .pdf-modal { padding: 0; }
  .pdf-modal__container {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-top: none;
    border-left: 3px solid var(--gold);
  }
}

/* === COOKIE CONSENT BANNER ================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2500;
  background: #f8f5f0;
  border-top: 3px solid var(--gold);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  padding: 18px 24px;
  transform: translateY(0);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.cookie-banner.is-hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.cookie-banner__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner__icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.cookie-banner__text {
  flex: 1;
  min-width: 200px;
}

.cookie-banner__text p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  color: #1a1a1a;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner__text a {
  color: var(--burgundy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner__text a:hover { color: var(--dark); }

.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

.cookie-banner__accept {
  display: inline-block;
  padding: 10px 24px;
  background-color: var(--gold);
  color: var(--dark);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  border-radius: 1px;
  transition: all var(--transition);
  white-space: nowrap;
}
.cookie-banner__accept:hover {
  background-color: var(--dark);
  color: #fff;
}

.cookie-banner__decline {
  background: none;
  border: 1px solid #ccc;
  color: #444;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 9px 14px;
  border-radius: 1px;
  transition: all var(--transition);
  white-space: nowrap;
}
.cookie-banner__decline:hover {
  border-color: #888;
  color: #111;
}

@media (max-width: 600px) {
  .cookie-banner { padding: 16px 18px; }
  .cookie-banner__inner { gap: 14px; }
  .cookie-banner__icon { display: none; }
  .cookie-banner__text { min-width: 0; }
  .cookie-banner__actions { width: 100%; justify-content: stretch; }
  .cookie-banner__accept { flex: 1; text-align: center; }
  .cookie-banner__decline { flex: 1; text-align: center; }
}

/* === COOKIE POLICY PAGE =================================== */
.policy-section {
  padding: 60px 0 80px;
  background: #ffffff;
}

.policy-section .mat-container {
  max-width: 820px;
}

.policy-content h2 {
  font-size: 1.5rem;
  color: #111111;
  margin: 36px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
}

.policy-content h2:first-child { margin-top: 0; }

.policy-content p {
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.75;
  margin: 10px 0;
}

.policy-content strong {
  color: #000000;
}

.policy-content ul {
  list-style: disc;
  padding-left: 24px;
  margin: 10px 0;
}

.policy-content ul li {
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.75;
  margin: 4px 0;
}

.policy-content ul li a {
  color: var(--burgundy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.policy-content ul li a:hover { color: #000000; }

.policy-updated {
  margin-top: 40px;
  padding: 16px 20px;
  background: #f5f0e8;
  border-left: 3px solid var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  color: #333333;
}
