@import url('https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,700;0,800;1,700&family=Montserrat:wght@400;500;600;700&display=swap');

/* ==========================================
   DESIGN TOKENS & VARIABLE DECLARATIONS
   ========================================== */
:root {
  --bg-color: #F4F1EA;       /* Warm Off-White / Cream */
  --text-color: #111111;     /* Deep Seal Black / Graphite */
  --accent-color: #E63917;   /* Gdynia Red */
  --secondary-color: #4A7BB0;/* Sea Blue */
  --white: #FFFFFF;
  --text-muted: #666666;
  --text-light: #888888;
  --border-light: rgba(0, 0, 0, 0.08);
  --border-dark: rgba(255, 255, 255, 0.1);
  
  --font-heading: 'Merriweather Sans', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

/* ==========================================
   LAYOUT STRUCTURE
   ========================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-spacing {
  margin-top: 80px;
  margin-bottom: 80px;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-weight: 800;
  font-size: 42px;
}

h2 {
  font-size: 28px;
  line-height: 1.3;
}

h3 {
  font-size: 18px;
  line-height: 1.4;
}

h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-color);
  margin-bottom: 16px;
}

.lead-text {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  color: #222222;
  transition: var(--transition-smooth);
}

.card-excerpt {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 8px;
  transition: var(--transition-fast);
}

.meta-text {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent-color);
  display: inline-block;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn-outline {
  display: inline-block;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--text-color);
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-outline:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.btn-text-arrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-color);
  position: relative;
  padding-bottom: 4px;
}

.btn-text-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: var(--transition-smooth);
}

.btn-text-arrow:hover {
  color: var(--accent-color);
}

.btn-text-arrow:hover::after {
  width: 100%;
}

/* ==========================================
   COMPONENTS: ARTICLE CARDS
   ========================================== */
.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
}

.card-img-wrapper {
  display: block;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
}

.card-img-wrapper.portrait {
  aspect-ratio: 3 / 4;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.card:hover .card-img {
  transform: scale(1.03);
}

.card-title {
  color: var(--text-color);
  transition: var(--transition-fast);
}

.card:hover .card-title {
  color: var(--secondary-color);
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
.header-wrapper {
  background-color: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.brand:hover .brand-logo {
  transform: rotate(5deg) scale(1.02);
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  transition: var(--transition-smooth);
}

.meta-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.meta-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.meta-link:hover {
  color: var(--text-color);
}

.header-nav {
  position: relative; /* Anchor for the full-width mega menu */
}

.nav-list {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 20px 0;
  transition: var(--transition-smooth);
}

.nav-item {
  /* Removed position: relative to allow mega-menu absolute positioning relative to .header-nav */
  padding: 10px 0;
}

.nav-link {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-color);
  display: flex;
  align-items: center;
  position: relative;
}

/* Hover dot indicator for active category when Mega Menu is open */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-color);
  transition: var(--transition-fast);
  opacity: 0;
}

.nav-item:hover .nav-link::after,
.nav-item.active-menu .nav-link::after {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* Scrolled Header State */
.header-wrapper.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  background-color: rgba(244, 241, 234, 0.95);
  backdrop-filter: blur(10px);
}

.header-wrapper.scrolled .header-top {
  padding: 12px 0;
}

.header-wrapper.scrolled .brand-logo {
  width: 48px;
  height: 48px;
}

.header-wrapper.scrolled .brand-name {
  font-size: 20px;
}

.header-wrapper.scrolled .nav-list {
  padding: 12px 0;
}

/* ==========================================
   MEGA MENU SYSTEM
   ========================================== */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background-color: var(--white);
  padding: 48px 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
              transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              visibility 0.3s;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
  z-index: 99;
}

/* Trigger mega menu on hover of its parent list item */
.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 250px;
  gap: 32px;
  max-width: 1152px;
  margin: 0 auto;
}

.mega-post {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mega-post .card-img-wrapper {
  aspect-ratio: 16 / 9;
}

.mega-post-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text-color);
  transition: var(--transition-fast);
}

.mega-post:hover .mega-post-title {
  color: var(--secondary-color);
}

.mega-cta-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 24px;
  border-left: 1px solid var(--border-light);
}

.mega-cta-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-mega-cta {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  background-color: var(--secondary-color);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: var(--transition-smooth);
}

.btn-mega-cta:hover {
  background-color: var(--accent-color);
}

/* ==========================================
   SEKCJA HERO: EDITORIAL ASYMMETRIC GRID
   ========================================== */
.hero-section {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr;
  gap: 48px;
  margin-top: 40px;
}

/* Left Column: The Statement */
.hero-statement {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-statement .card-img-wrapper {
  aspect-ratio: 16 / 9;
}

.hero-statement h1 {
  transition: var(--transition-fast);
  cursor: pointer;
}

.hero-statement:hover h1 {
  color: var(--secondary-color);
}

/* Right Column: The Strumień */
.hero-stream {
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-left: 1px solid var(--border-light);
  padding-left: 48px;
}

.hero-stream .card {
  gap: 12px;
}

.hero-stream .card-img-wrapper {
  aspect-ratio: 16 / 10;
}

.hero-stream .card:active .card-img {
  transform: scale(0.98);
}

/* ==========================================
   SEKCJA A: LUDZIE I KULTURA (3-COL GRID)
   ========================================== */
.section-header {
  position: relative;
  margin-bottom: 40px;
  text-align: center;
}

.section-header.left-aligned {
  text-align: left;
}

.section-header::after {
  content: '';
  display: block;
  width: 80px;
  height: 1px;
  background-color: var(--secondary-color);
  margin: 12px auto 0;
}

.section-header.left-aligned::after {
  margin: 12px 0 0;
}

.grid-3-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.section-footer-cta {
  text-align: center;
  margin-top: 48px;
}

/* ==========================================
   SEKCJA B: ŻYCIE MIASTA (SPLIT LAYOUT)
   ========================================== */
.split-container {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.split-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: center;
}

.split-row.reversed {
  grid-template-columns: 0.8fr 1.2fr;
}

.split-img-col {
  width: 100%;
}

.split-img-col .card-img-wrapper {
  display: block;
  width: 100%;
  height: 380px; /* Hardcoded horizontal height */
}

.split-text-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================
   PRZERYWNIK: MORSKI HORYZONT
   ========================================== */
.breakout-section {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: linear-gradient(rgba(74, 123, 176, 0.82), rgba(74, 123, 176, 0.82)), 
              url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=80') no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--white);
  padding: 120px 24px;
  text-align: center;
  overflow: hidden;
}

.breakout-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.breakout-tag {
  color: var(--white);
  opacity: 0.8;
}

.breakout-quote {
  font-family: var(--font-heading);
  font-weight: 700;
  font-style: italic;
  font-size: 32px;
  line-height: 1.4;
  color: var(--white);
}

.btn-outline-white {
  display: inline-block;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--white);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 16px;
}

.btn-outline-white:hover {
  background-color: var(--white);
  color: var(--secondary-color);
}

/* ==========================================
   SEKCJA: WSPÓŁPRACE (NGO)
   ========================================== */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.partner-card {
  background-color: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  transition: var(--transition-smooth);
  border: 1px solid var(--border-light);
}

.partner-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-color: var(--secondary-color);
}

.partner-img-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--bg-color);
}

.partner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.partner-info h5 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 6px;
}

.partner-info p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ==========================================
   SEKCJA: INICJATYWY (FEATURED + LIST LAYOUT)
   ========================================== */
.initiatives-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 40px;
}

.initiatives-featured {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.initiatives-featured .card-img-wrapper {
  aspect-ratio: 4 / 3;
}

.initiatives-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.initiative-list-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  cursor: pointer;
}

.initiative-list-item .item-img-wrap {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  overflow: hidden;
}

.initiative-list-item .item-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.initiative-list-item:hover .item-img-wrap img {
  transform: scale(1.04);
}

.initiative-list-item .item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.initiative-list-item .item-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text-color);
  transition: var(--transition-fast);
}

.initiative-list-item:hover .item-title {
  color: var(--secondary-color);
}

.initiative-list-item .item-excerpt {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

/* ==========================================
   SEKCJA C: KRONIKA MIEJSKA (4-COL GRID)
   ========================================== */
.grid-4-col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.grid-4-col .card {
  gap: 12px;
}

.grid-4-col .card-title {
  font-size: 16px;
  line-height: 1.4;
}

/* ==========================================
   FOOTER (STOPKA PREMIUM)
   ========================================== */
.footer-wrapper {
  background-color: var(--text-color);
  color: var(--bg-color);
  padding: 80px 0 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1.2fr;
  gap: 48px;
  margin-bottom: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 12px;
  margin-bottom: 0;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 1px;
  background-color: var(--secondary-color);
}

.footer-brand {
  align-items: flex-start;
}

.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.footer-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  filter: grayscale(1) brightness(1.8);
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--white);
}

.footer-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  font-size: 14px;
  color: var(--text-light);
}

.footer-link:hover {
  color: var(--white);
  padding-left: 4px;
}

.footer-social-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
  margin-bottom: 8px;
}

.btn-facebook-cta {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  transition: var(--transition-smooth);
}

.btn-facebook-cta:hover {
  background-color: var(--white);
  color: var(--accent-color);
  box-shadow: 0 4px 15px rgba(230, 57, 23, 0.4);
}

.footer-bottom {
  border-top: 1px solid var(--border-dark);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.copyright {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.credits {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.credits a {
  color: var(--white);
  font-weight: 600;
}

.credits a:hover {
  color: var(--accent-color);
}

/* ==========================================
   MOBILE INTERACTION & RESPONSIVENESS
   ========================================== */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-color);
  padding: 8px;
}

@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 32px;
  }
  .hero-stream {
    padding-left: 24px;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

@media (max-width: 850px) {
  /* Header adjustments */
  .meta-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .header-nav {
    display: none; /* Collapsed by default on mobile, triggered by JS */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  }
  
  .header-nav.mobile-active {
    display: block;
  }
  
  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
  }
  
  .nav-item {
    width: 100%;
    text-align: center;
    padding: 8px 0;
  }
  
  .nav-link {
    justify-content: center;
  }
  
  /* Disable mega menu on mobile, replace with standard links or basic dropdowns */
  .mega-menu {
    display: none !important;
  }
  
  /* Main Layout */
  .hero-section {
    grid-template-columns: 1fr;
  }
  
  .hero-stream {
    border-left: none;
    padding-left: 0;
    margin-top: 32px;
  }
  
  .grid-3-col {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .split-row, .split-row.reversed {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .split-row.reversed .split-img-col {
    order: -1;
  }
  
  .breakout-section {
    background-attachment: scroll;
  }
  
  .breakout-quote {
    font-size: 24px;
  }
  
  .partner-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .initiatives-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .grid-4-col {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  /* Excerpt overrides for mobile size check */
  .lead-text {
    font-size: 15px;
    line-height: 1.5;
  }
  
  .card-excerpt {
    font-size: 13px;
  }
  .split-img-col .card-img-wrapper {
    height: 300px;
  }
}

@media (max-width: 550px) {
  h1 {
    font-size: 30px;
  }
  h2 {
    font-size: 20px;
  }
  .grid-3-col, .grid-4-col, .partner-grid {
    grid-template-columns: 1fr;
  }
  .split-img-col .card-img-wrapper {
    height: 200px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
