/* ============================================================
   ESTUDIANTINA BERGAMO — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Nunito+Sans:wght@300;400;600;700&display=swap');

:root {
  --cream:      #EFF3F9;
  --cream-dark: #DDE5F0;
  --nav-bg:     #071428;
  --gold:       #4A90D9;
  --gold-light: #82B8EE;
  --sienna:     #1A4F8A;
  --text:       #0D1F3C;
  --text-muted: #4A6080;
  --white:      #FFFFFF;
  --border:     #C8D8EC;
  --shadow:     0 4px 20px rgba(7,20,40,.10);
  --shadow-lg:  0 8px 40px rgba(7,20,40,.18);
  --r:          10px;
  --r-lg:       18px;
  --ease:       0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.75;
}

img { display: block; max-width: 100%; }
a   { color: var(--sienna); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--gold); }
ul  { list-style: none; }

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 68px;
  background: rgba(7,20,40,0.97);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  border-bottom: 1px solid rgba(74,144,217,0.2);
}

.nav-logo {
  display: flex; align-items: center; gap: .75rem; text-decoration: none;
}
.nav-logo img { height: 44px; }
.nav-logo span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; color: var(--gold);
  font-weight: 600; letter-spacing: .06em;
}

.nav-links { display: flex; gap: .1rem; }
.nav-links a {
  color: #ffffff;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .45rem .8rem;
  border-radius: 6px; border: 1px solid transparent;
  transition: all var(--ease); text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  border-color: rgba(74,144,217,.4);
  background: rgba(74,144,217,.07);
}

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
  background: none; border: none;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--gold); border-radius: 2px; transition: all .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu drawer */
.mobile-menu {
  display: none; position: fixed;
  top: 68px; left: 0; right: 0;
  background: rgba(7,20,40,.98);
  padding: 1rem 1.5rem 1.5rem;
  z-index: 999;
  border-bottom: 1px solid rgba(74,144,217,.2);
  flex-direction: column; gap: .25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: #ffffff; font-weight: 700;
  font-size: .85rem; letter-spacing: .12em;
  text-transform: uppercase;
  padding: .7rem 1rem; border-radius: 6px;
  text-decoration: none; transition: all var(--ease);
}
.mobile-menu a:hover {
  color: var(--gold); background: rgba(74,144,217,.08);
}

/* ── PAGE HEADER (inner pages) ───────────────────────────── */
.page-header {
  margin-top: 68px;
  padding: 3.5rem 2rem 2.5rem;
  background: var(--nav-bg);
  text-align: center;
  position: relative; overflow: hidden;
}
.page-header::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center top, rgba(74,144,217,.15) 0%, transparent 60%);
  pointer-events: none;
}
.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem; font-weight: 600;
  color: var(--cream); letter-spacing: .02em;
  position: relative; z-index: 1;
}
.page-header h1 em { color: var(--gold); font-style: italic; }
.page-header p {
  color: var(--gold-light); font-size: .85rem;
  letter-spacing: .2em; text-transform: uppercase;
  margin-top: .5rem; position: relative; z-index: 1;
}
.header-rule {
  display: block; width: 50px; height: 2px;
  background: var(--gold); margin: 1.25rem auto 0;
  position: relative; z-index: 1;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
main { padding: 3rem 0 4rem; }

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem; font-weight: 700;
  color: var(--text); text-align: center;
}
h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem; color: var(--sienna); margin: 1.5rem 0 .75rem;
}
h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem; color: var(--text); margin: 1rem 0 .4rem;
}
p { color: var(--text-muted); margin-bottom: 1rem; }

.rule { display: block; width: 50px; height: 2px; background: var(--gold); }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-body { padding: 1.5rem; }
.card-img { width: 100%; cursor: pointer; }
.card-img img { width: 100%; height: auto; display: block; }

/* ── GRID ────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: 50px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: .82rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none;
  transition: all var(--ease); cursor: pointer; border: none;
}
.btn-primary { background: var(--sienna); color: var(--white); }
.btn-primary:hover { background: #103a6b; color: var(--white); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(26,79,138,.35); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-light); color: var(--nav-bg); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--sienna); border: 2px solid var(--sienna); }
.btn-outline:hover { background: var(--sienna); color: var(--white); }
.btn-dark { background: var(--nav-bg); color: var(--white); }
.btn-dark:hover { background: #0a1e40; color: var(--gold); transform: translateY(-2px); }

/* ── CONTENT BLOCK (image + text) ────────────────────────── */
.content-block {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 2.5rem;
  margin-bottom: 3rem;
}
.content-block.reverse { flex-direction: row-reverse; }
.content-block .cb-img { flex: 0 0 auto; width: min(380px, 100%); }
.content-block .cb-img img { width: 100%; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.content-block .cb-text { flex: 1 1 280px; }
.content-block .cb-text h2 { margin-top: 0; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  z-index: 2000; background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
  padding: 2rem; cursor: pointer;
}
.modal-overlay.open { display: flex; }
.modal-overlay img {
  max-width: 90%; max-height: 85vh;
  border-radius: var(--r); cursor: default;
  box-shadow: 0 0 60px rgba(0,0,0,.6);
}
.modal-close {
  position: fixed; top: 1.25rem; right: 1.75rem;
  color: white; font-size: 2.5rem;
  cursor: pointer; line-height: 1;
  transition: color var(--ease); z-index: 2001;
}
.modal-close:hover { color: var(--gold); }

/* ── SCROLL TOP ──────────────────────────────────────────── */
#scrollTop {
  display: none; position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 900; background: var(--sienna); color: white;
  border: none; width: 46px; height: 46px;
  border-radius: 50%; cursor: pointer; font-size: 1.1rem;
  box-shadow: var(--shadow); transition: all var(--ease);
  align-items: center; justify-content: center;
}
#scrollTop.visible { display: flex; }
#scrollTop:hover { background: var(--nav-bg); transform: translateY(-3px); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--nav-bg);
  color: rgba(245,239,230,.55);
  text-align: center; padding: 1.75rem 2rem;
  font-size: .82rem; letter-spacing: .05em;
  border-top: 1px solid rgba(74,144,217,.15);
}
footer a { color: var(--gold); }

/* ── CONTACT & SOCIAL ────────────────────────────────────── */
.contact-box {
  background: var(--white); border-radius: var(--r-lg);
  padding: 1.75rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.contact-row {
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-row:last-child { border-bottom: none; }
.contact-label {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .1rem;
}
.social-row {
  display: flex; justify-content: center;
  gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0;
}
.social-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1.2rem; background: var(--white);
  border-radius: 50px; box-shadow: var(--shadow);
  font-weight: 600; font-size: .85rem; color: var(--text);
  transition: all var(--ease); text-decoration: none;
}
.social-link img { height: 22px; }
.social-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }

/* ── MEDIA PAGE ──────────────────────────────────────────── */
.media-section {
  background: var(--white); border-radius: var(--r-lg);
  padding: 2rem; box-shadow: var(--shadow); margin-bottom: 2rem;
}
.media-section h2 { margin-top: 0; }
.media-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .75rem 0; border-bottom: 1px solid var(--border);
  color: var(--text); font-weight: 600; transition: color var(--ease);
}
.media-link:last-child { border-bottom: none; }
.media-link:hover { color: var(--sienna); }
.media-link img { height: 20px; flex-shrink: 0; }
.cf-box {
  background: linear-gradient(135deg, #1A4F8A, #071428);
  color: var(--white); border-radius: var(--r-lg);
  padding: 2.5rem 2rem; text-align: center; margin-bottom: 2rem;
}
.cf-box h2 { color: var(--cream); margin-top: 0; }
.cf-code {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem; font-weight: 700;
  color: var(--gold-light); letter-spacing: .15em; margin: .5rem 0;
}

/* ── UTILITY ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-center { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 2rem; }
  .content-block { gap: 1.5rem; }
  .content-block .cb-img { width: 100%; }
}
@media (max-width: 520px) {
  .page-header h1 { font-size: 1.55rem; }
  .page-header { padding: 2.5rem 1.25rem 2rem; }
  .card-body { padding: 1.25rem; }
  .nav-logo span { display: none; }
}