:root {
  --primary:#22237d;
  --white:#fff;
  --gray-bg:#f4f4f4;
  --shadow:0 2px 8px rgba(34,35,125,0.1);
  --radius:16px;
  --font:'Segoe UI','Roboto',sans-serif;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  background: var(--gray-bg);
  color: #222;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* Navbar */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: auto;
  padding: .5rem 1.5rem;
}
.logo img { height:80px; width:80px; }
.nav-links {
  list-style:none;
  display:flex;
  gap:2rem;
  margin:0;
}
.nav-links a {
  text-decoration:none;
  color:#222;
  font-weight:500;
  padding:.4rem .7rem;
  border-radius:8px;
  transition:.2s;
}
.nav-links a.active,
.nav-links a:hover {
  background:var(--primary);
  color:var(--white);
}
.burger {
  display:none;
  font-size:2rem;
  cursor:pointer;
}

/* Section */
.section {
  max-width:1200px;
  margin:2rem auto;
  padding:0 1.5rem;
  flex: 1;
}
.section-title {
  font-size:2rem;
  color:var(--primary);
  margin-bottom:1.5rem;
}

/* News Grid Horizontal */
.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 cards horizontal */
  gap: 2rem;
}

/* Responsive adjustments */
@media(max-width:1024px){
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media(max-width:768px){
  .news-grid { grid-template-columns: 1fr; }
}

/* News Card */
.news-card {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  position:relative;
  transition:all .4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(34,35,125,0.2);
}

.card-inner { 
  display:block; 
  transition:all .3s ease; 
}

.news-img { 
  width:100%; 
  height:240px; 
  object-fit:cover; 
  transition:transform .4s ease; 
  overflow: hidden;
}

.news-card:hover .news-img {
  transform: scale(1.05);
}

.news-content { 
  display:flex; 
  flex-direction:column; 
  min-height: 280px; 
  padding:1rem 1.2rem 4rem 1.2rem; 
  position:relative; 
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  padding-bottom: 4rem;
}

.news-content h3 { 
  color:var(--primary); 
  margin:.3rem 0; 
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.news-card:hover .news-content h3 {
  color: #1a1b5c;
}

.news-date { 
  color:#777; 
  font-size:.9rem; 
  font-weight: 500;
}

.excerpt { 
  color:#333; 
  line-height: 1.5;
}

.full-text { 
  display:none; 
  margin-top:1rem; 
  line-height: 1.6;
}

/* Buttons */
.btn-secondary {
  background:var(--primary);
  color:var(--white);
  padding:.5rem 1.4rem;
  border-radius:24px;
  position:absolute;
  bottom:1rem;
  font-size:.9rem;
  text-align:center;
  cursor:pointer;
  transition:all .3s ease;
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  z-index: 10;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-secondary:hover::before {
  left: 100%;
}

.btn-secondary:hover { 
  background:#18195a; 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34,35,125,0.3);
}

.news-content { position:relative; padding-bottom:4rem; }
.news-content .read-toggle { left:1rem; transform:none; }
.news-content .go-back { right:1rem; transform:none; }
.go-back { display:none; }

/* Footer */
.footer {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: auto;
}
.footer-social {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
.footer-social a {
  color: var(--white);
  font-size: 1.5rem;
  transition: .2s;
}
.footer-social a:hover { color: #ffdc00; }

/* =================== RESPONSIVE DESIGN =================== */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
  .section {
    padding: 0 1.5rem;
  }
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* Tablets */
@media (max-width: 900px) {
  .navbar-container {
    padding: 0.75rem 1.5rem;
  }
  
  .section {
    padding: 0 1.25rem;
    margin: 1.5rem auto;
  }
  
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
  .navbar-container {
    padding: 0.5rem 1rem;
    position: relative;
  }
  
  .burger {
    display: block;
    font-size: 1.75rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
  }
  
  .burger:hover {
    background: #f0f2ff;
  }
  
  .burger.active {
    background: var(--primary);
    color: var(--white);
  }
  
  .nav-links {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    background: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: 2rem;
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    overflow-y: auto;
  }
  
  .nav-links.nav-active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  
  .nav-links a {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    min-width: 180px;
  }
  
  .nav-links a:hover {
    background: var(--primary);
    color: var(--white);
  }
  
  /* Close button for mobile menu - hidden on desktop */
  .nav-links .close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
  }
  
  .nav-links .close-btn:hover {
    background: #18195a;
  }
  
  .navbar-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .section {
    padding: 0 1rem;
    margin: 1.25rem auto;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .news-card {
    margin-bottom: 1rem;
  }
  
  .news-content {
    padding: 1rem 1rem 3.5rem 1rem;
    min-height: 260px;
  }
  
  .news-content h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }
  
  .news-date {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }
  
  .excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  .btn-secondary {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 20px;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
  }
  
  .footer {
    padding: 1.5rem 1rem 1rem 1rem;
    margin-top: 2rem;
    min-height: auto;
    position: relative;
    bottom: 0;
  }
  
  .footer-content {
    padding: 0;
    margin: 0;
  }
  
  .footer-social {
    gap: 1.25rem;
    margin: 1rem 0;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .navbar-container {
    padding: 0.5rem 0.75rem;
  }
  
  .section {
    padding: 0 0.75rem;
    margin: 1rem auto;
  }
  
  .news-content {
    padding: 0.875rem 0.875rem 3rem 0.875rem;
    min-height: 240px;
  }
  
  .news-content h3 {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
  }
  
  .news-date {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
  }
  
  .excerpt {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 18px;
  }
  
  .section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .footer {
    padding: 1.25rem 0 0.75rem 0;
  }
  
  .footer-social {
    gap: 1rem;
  }
  
  .footer-social a {
    font-size: 1.25rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .section {
    padding: 0 0.5rem;
  }
  
  .news-content {
    padding: 0.75rem 0.75rem 2.5rem 0.75rem;
    min-height: 220px;
  }
  
  .news-content h3 {
    font-size: 0.95rem;
    line-height: 1.2;
  }
  
  .news-date {
    font-size: 0.8rem;
  }
  
  .excerpt {
    font-size: 0.85rem;
  }
  
  .btn-secondary {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 16px;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
}

/* Hide close button on desktop */
@media (min-width: 769px) {
  .nav-links .close-btn {
    display: none;
  }
}
