/* ================= BREAKPOINTS ================= */
/*
  sm: 480px
  md: 768px
  lg: 1024px
  xl: 1280px
*/
:root {
  --red: #D32F2F;
  --red-hover: #E53935;
  --text-main: #1f1f1f;
  --text-muted: #6b6b6b;
  --bg-light: #f7f7f7;

  /* ===== TYPOGRAPHY SCALE ===== */
  --fs-xxs: 0.95rem;
  --fs-xs: 1.1rem;
  --fs-sm: 1.2rem;
  --fs-base: 1.3rem;
  --fs-md: 1.5rem;
  --fs-lg: 1.7rem;
  --fs-xl: 2.3rem;
  --fs-xxl: 3rem;
  --fs-hero: 4rem;

  /* spacing scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-smd: 24px;
  --space-md: 32px;
  --space-ml: 48px;
  --space-lg: 64px;
  --space-xl: 80px;
  --space-xxl: 100px;
}

h1 {
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
}

p {
  font-size: var(--fs-base);
  line-height: 1.8;
}

li{
  font-size: var(--fs-base);
  line-height: 1.7;
}

a{
  font-size: var(--fs-sm);
}

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* BASE */
body {
  font-family: "Inter", sans-serif;
  background: #fff;
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--red);
  text-decoration: none;
}

a:hover {
  color: var(--red-hover);
}

/* LAYOUT */
.container {
  width: min(1500px, 90%);
  margin: 0 auto;
  padding: 0 var(--space-smd);
}

/* Calendar */
/* ================================================= */
/* ================= MINI CALENDAR ================= */
/* ================================================= */

.calendar-item {
  position: relative;
}

/* ---------- DROPDOWN ---------- */

.calendar-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;

  transform: translate(-50%, 8px);
  opacity: 0;
  visibility: hidden;

  background: #fff;
  padding: var(--space-sm);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);

  width: 320px;
  max-width: 20vw;

  transition: opacity 0.25s ease, transform 0.25s ease;

  z-index: 2000;
}

.calendar-item:hover .calendar-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- HEADER ---------- */

.mini-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.mini-calendar-header button {
  background: var(--red);
  color: #fff;
  border: none;

  width: 34px;
  height: 34px;

  border-radius: 8px;
  cursor: pointer;

  font-size: 1rem;
  font-weight: 600;

  transition: background 0.2s ease, transform 0.1s ease;
}

.mini-calendar-header button:hover {
  background: var(--red-hover);
}

.mini-calendar-header button:active {
  transform: scale(0.95);
}

#miniMonthYear {
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--text-main);
}

/* ---------- GRID ---------- */

.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-xs);
  width: 100%;
  box-sizing: border-box;
}

/* Day cell */

.mini-calendar-grid div {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;

  background: #f4f4f4;
  border-radius: 10px;

  font-size: 0.9rem;
  font-weight: 500;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  transition: background 0.2s ease, transform 0.1s ease;
}


/* Bultiņa zem taisnstūra */
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);

  width: 0;
  height: 0;

  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #ffffff; /* tāds pats kā box fons */

  /* kontūra bultiņai */
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}


.mini-calendar-grid div:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}


/* Hover */

.mini-calendar-grid div:hover {
  background: #e9e9e9;
}

/* Active click feel */

.mini-calendar-grid div:active {
  transform: scale(0.95);
}

/* ---------- EVENT DAY ---------- */

.mini-calendar-grid .event {
  background: var(--red);
  color: #fff;
  font-weight: 600;
  padding: 0%;
}

.mini-calendar-grid .event:hover {
  background: var(--red-hover);
}

.mini-calendar-grid .today {
  border: 2px solid var(--text-main);
}

/* ================================================= */
/* ================= EVENT MODAL ================= */
/* ================================================= */

.event-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  visibility: hidden;

  transition: opacity 0.25s ease;
  z-index: 5000;
}

.event-modal[hidden],
.event-modal [hidden] {
  display: none;
}

.event-modal.active {
  opacity: 1;
  visibility: visible;
}

.event-modal-content {
  max-width: 500px;
  width: 90%;

  padding: 40px;
  max-height: 90dvh;
  overflow-y: auto;
  box-sizing: border-box;
  border-radius: 20px;

  position: relative;
  background: #fff;
   z-index: 6000;

  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.event-modal.active .event-modal-content {
  transform: scale(1);
}

.event-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);

  background: none;
  border: none;

  font-size: var(--fs-base);
  cursor: pointer;

  color: var(--red);
}

.event-date {
  margin: var(--space-xs) 0 var(--space-sm);
  font-weight: 600;
  color: var(--text-muted);
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  z-index: 1000;

  border-bottom: 3px solid transparent;
  background-image: linear-gradient(#fff, #fff),
                    linear-gradient(135deg, #D32F2F, #B71C1C);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100px;
}

/* LOGO */
.logo img {
  height: 90px;
  width: auto;
  display: block;
}

/* NAV */
.nav {
  display: flex;
  align-items: center;
}

.nav a {
  margin-left: var(--space-smd);
  font-weight: 500;
  color: var(--text-main);
  font-size: var(--fs-base);
}

.nav a:hover {
  color: var(--red);
}

/* EU DROPDOWN */
.eu-item {
  position: relative;
}

.eu-item > a::after {
  content: "▾";
  margin-left: 6px;
  font-size: 0.8em;
}

.eu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;

  background: #fff;
  min-width: 180px;

  display: flex;
  flex-direction: column;

  padding: var(--space-xs) 0;

  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  border-radius: 8px;

  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
}

.eu-dropdown a {
  padding: var(--space-xs) var(--space-sm);
  font-size: 1rem;
  color: var(--text-main);
}

.eu-dropdown a:hover {
  background: var(--bg-light);
  color: var(--red);
}

.eu-item:hover .eu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* LANGUAGE SWITCH */
.lang-switch {
  margin-left: var(--space-smd);
  background: none;
  border: 2px solid var(--red);
  color: var(--red);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-switch:hover {
  background: var(--red);
  color: #fff;
}

/* HERO */
.hero {
  min-height: calc(100svh - 100px);
  height: auto;
  padding: var(--space-xl) 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  background-image: url("../img/archive/main_background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  color: #fff;
}

.hero h1 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-smd);
}

.hero p {
  max-width: 900px;
  margin: 0 auto var(--space-md) auto;
  color: rgba(255, 255, 255, 0.85);
}

.hero h1 span.first-letter {
  color: var(--red);
}

/* HERO BTN */
.btn-primary {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 1.2rem;
  padding: var(--space-smd) var(--space-md);
  border-radius: 5px;
  border: 2px solid var(--red);
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-top: var(--space-md);
}

.btn-primary:hover {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
}

/* SECTIONS */
.section {
  padding: var(--space-xl) 0;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-light {
  background: var(--bg-light);
}

.section-title {
  text-align: center;
  font-size: var(--fs-xl);
  margin-bottom: var(--space-ml);
}

/* GRID */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

/* CARDS */
.card {
  background: #fff;
  padding: var(--space-md);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
}

/* CONTACT */
.contact-card {
  text-align: center;
}

.contact-photo {
  width: clamp(88px, 18vw, 120px);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--space-sm) auto;
  display: block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* CONTACT (robust layout) */
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-xs);
}

.contact-card > * {
  max-width: 100%;
}

/* Make spacing consistent */
.contact-card h3 {
  margin: var(--space-xs) 0 var(--space-xs)/2 0;
}

.contact-card p {
  margin: 0;
}

/* Email/link behavior */
.contact-card a {
  display: inline-block;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

/* ABOUT */
#about h3 {
  margin-top: var(--space-smd);
  margin-bottom: var(--space-xs);
}

#about p {
  margin-bottom: var(--space-sm);
}

#about ul {
  margin-bottom: var(--space-smd);
  padding-left: var(--space-sm);
}

#about li {
  margin-bottom: var(--space-xs);
}

/* ABOUT CONTAINER */
#about .card {
  padding: var(--space-md);
  border-radius: 24px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: justify;

  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
}

/* ABOUT EXPANDABLE */
.about-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease;
}

.about-expand.open {
  max-height: 5000px;
  opacity: 1;
}

.about-toggle {
  border: none;
  outline: none;
}
.about-toggle:focus {
  outline: none;
  box-shadow: none;
}

/* NEWS */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 1000px;
  margin: 0 auto;
}

.news-card {
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transition: 0.3s;
  min-height: auto;
  display: flex;
  flex-direction: column;
  border-radius: 60px;
}

.news-card:hover {
  transform: translateY(-8px);
}

.news-image {
  aspect-ratio: 16/9;
  width:100%;
  height: auto;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.news-date {
  position: absolute;
  bottom: var(--space-xs);
  left: var(--space-xs);
  background: #2c7a7b;
  color: #fff;
  padding: var(--space-xs) var(--space-xs);
  font-size: var(--fs-xs);
  border-radius: 6px;
  font-weight: 600;
}

.news-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-content h3 {
  margin-bottom: var(--space-xs);

}

.news-content p {
  color: #666;
  margin-bottom: var(--space-smd);
}

.news-toggle {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: var(--space-xs);
  font-size: var(--fs-xs);
}

.news-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.3s ease;
}

.news-expand.open {
  max-height: 500px;
  opacity: 1;
  margin-top: var(--space-xs);
}

/* LINKS */
.news-btn {
  font-weight: 600;
  color: var(--red);
}
.news-btn:hover {
  text-decoration: underline;
}

/* OTHER */
#fcbook,
#inst {
  font-size: var(--fs-base);
}

.roles-block h4 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

/* FOOTER */
/* ================= FOOTER ================= */

.footer {
  background: #1f1f1f;
  color: #fff;
  padding: var(--space-lg) 0 var(--space-md);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

/* Partner Logos */
.partners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-md);
  width: 100%;
  max-width: 900px;
  align-items: center;
  justify-items: center;
}

.partners img {
  max-width: 140px;
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.partners img:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Copyright */
.footer p {
  text-align: center;
  font-size: var(--fs-xxs);
  opacity: 0.8;

  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-smd);
  margin-top: var(--space-smd);
}

/* PARTNERS */
.partners {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-smd);
  flex-wrap: wrap;
}

.partners img {
  height: 60px;
  width: auto;
  filter: grayscale(100%) brightness(180%);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.partners img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

/* Bigger & brighter main partners */
.partners img.partner-large {
  height: 85px;
  filter: grayscale(100%) brightness(115%);
  opacity: 1;
}

.partners img.partner-large:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

.partners img.partner-epsa {
  background: #fff;
  filter: grayscale(100%);
  opacity: 1;
}

.partners a:focus-visible img.partner-epsa {
  filter: grayscale(0%);
}

/* ================= BURGER ================= */
.burger {
  display: none; /* shown only on mobile */
  flex-direction: column;
  justify-content: center;
  gap: var(--space-xs);
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3000;
}

.burger span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* When burger is active */
.burger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Calendar keyboard access; preserve the seven-column grid and mobile toggle. */
@media (min-width: 1025px) {
  .eu-item:focus-within .eu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .calendar-item:focus-within .calendar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

.mini-calendar-grid .event:focus-visible,
.calendar-item button:focus-visible,
.event-modal :focus-visible {
  outline: 3px solid var(--text-main);
  outline-offset: 2px;
}

/* Home news: equal content-driven rows, without affecting EPSA cards. */
.home-news .container {
  padding-inline: 0;
}

.home-news .news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  max-width: none;
}

.home-news .news-card {
  min-width: 0;
}

.home-news .news-image {
  aspect-ratio: 4/3;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  padding: 12px;
  padding-top: 24px;
}

.home-news .news-content {
  overflow-wrap: anywhere;
}

.home-news .news-date {
  position: static;
  align-self: flex-start;
  max-width: 100%;
  margin-bottom: var(--space-xs);
}

.home-news .news-content > a {
  align-self: flex-start;
  margin-top: auto;
}

.home-news a:focus-visible,
.partners a:has(.home-partner-logo):focus-visible,
.partners a:has(.partner-epsa):focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

.partners img.home-partner-logo {
  width: 140px;
  max-width: 100%;
  height: 60px;
  object-fit: contain;
  filter: grayscale(100%);
}

.partners img.home-partner-logo:hover {
  filter: grayscale(0%);
}

@media (max-width: 1023.98px) {
  .home-news .news-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
