.headerAktobe{
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  background: #0b486b; /* dark blue gradient */
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
  font-family: 'Montserrat', sans-serif;
}

.main-nav{
  display: flex;
  align-items: center;
  gap: 22px;              /* free places through Flexbox */
}

.main-nav a{
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.main-nav a:hover{
  background: rgba(255,255,255,.12);
  color: #fff;
  transform: translateY(-1px);
}


.brend{ display: inline-flex; align-items: center; gap: 10px; }  /* logo in one line */
.brend i{ font-size: 20px; }

body{  /*removing default margin (white lines)*/
    margin: 0; 
    padding: 0;
}

.FirstInfo{
     width: 100%;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(180deg, #F2EEE9 0%, #C9D6DF 100%);
    font-family: 'Montserrat', sans-serif;
}

.InfoContainer {
    display: flex;     /* in row */
    justify-content: center;    
    gap: 40px;       /* space between blocks */
    background: linear-gradient(180deg, #F2EEE9 0%, #C9D6DF 100%);
    padding: 40px 20px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.InfoContainer div {
    flex: 1;
    max-width: 200px;
}

.InfoContainer i {  
    font-size: 40px;
    color: #4682B4;
    margin-bottom: 10px;
}

.InfoContainer h2 {
    font-size: 18px;
    margin: 10px 0;
    color: #222;
}

.InfoContainer p {
    font-size: 14px;
    color: #555;
}


.Description {
    max-width: 800px;
    margin: 0 auto;
    font-size: 19px;
    color: #66686b;
    line-height: 1.6;
    font-family: 'Montserrat', sans-serif;
}

#top-banner {
    text-align: left;          
    font-size: 26px;
    color: #0b486b;
    margin: 40px auto 10px;   
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    max-width: 800px;
 }

 #top-banner::after, .AttractionsTitle::after{
  content:"";
  display:block;
  width:80px; height:4px;
  background:linear-gradient(90deg,#0b486b,#16222A);
  border-radius:2px;
  margin-top:8px;
}


.AttractionsTitle {
   text-align: left;          
    font-size: 26px;
    color: #0b486b;
    margin: 40px auto 10px;    
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    max-width: 800px;
}

.LeftBank, .RightBank, .Culture, .Events {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 19px;
    color: #687c99;
    line-height: 1.6;
    font-family: 'Montserrat', sans-serif;
}

.LeftBankDescription, .RightBankDescription, .CultureDescription, .EventsDescription {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 21px;
    color: #435164;
    line-height: 1.6;  /* increased line height for better readability */
    font-family: 'Montserrat', sans-serif;
}

.GalleryTitle, .MapTitle {
    text-align: center;
    font-size: 28px;
    color: #0b486b;
    margin: 40px 0 20px;  /* spacing above and below */
    font-family: 'Montserrat', sans-serif;
}


.MapContainer {
    width: 100%;
    margin: 30px 0;
    border-radius: 0;
    overflow: hidden;   /* rounding the corners */
}

.MapContainer iframe {
    width: 100%;       /* full width map*/
    height: 500px;            
    border: none;
}

.FormTitle{  /* contact form title */
  text-align:center; 
  font-size:28px; 
  color:#0b486b; 
  margin:40px 0 10px;
  font-family:'Montserrat',sans-serif;
}

.contact-form{
  max-width:600px; 
  margin:0 auto 40px;
   display:grid;   /* grid layout for form elements */
   gap:12px; 
   padding:0 20px;
  font-family:'Montserrat',sans-serif;
}

.contact-form input, .contact-form textarea{
  width:100%; 
  padding:12px 14px; 
  border:1px solid #cbd5e1;   
  border-radius:10px;
}

.contact-form input:focus, .contact-form textarea:focus{
  outline:none; 
  border-color:#0b486b; 
  box-shadow:0 0 0 3px rgba(11,72,107,.15);  /* focus effect */
}

.contact-form button{
  padding:12px 16px; 
  background:#0b486b; 
  color:#fff; 
  border:0; 
  border-radius:10px;
  cursor:pointer; 
  font-weight:600; 
  transition:background .2s,transform .2s;
}

.contact-form button:hover{ 
    background:#16222A; 
    transform:translateY(-2px);   /* slight lift on hover */
}

/* footer */
.footer02 {
  text-align: center;
  padding: 15px;
  background: #0b3a5b;
  color: white;
  margin-top: 30px;
  font-family: 'Montserrat', sans-serif;
}

#github02{
  display: inline-block;
  color: #f8f9fa;
  text-decoration: none;
  margin-top: 10px;
    font-family: 'Montserrat', sans-serif;
}

#github02:hover{
  color: blue;
}

/*3rd assignment*/

/* so that the padding/border fits into the width and doesnt break the calculation */
.Gallery, .GalleryItem, .GalleryItem * { box-sizing: border-box; }

.Gallery{
  display: flex !important;         
  flex-wrap: wrap;                   /* multiple lines of 3 */
  gap: 20px;                         /* intervals between cards */
  padding: 12px 24px 32px;
  max-width: 1000px;                 /* container for 3 columns */
  margin: 0 auto;                    /* center */
  justify-content: center;          
}

/* 3 Columns: without fixed pixels, taking into account gap */
.GalleryItem{
  flex: 0 1 calc((100% - 40px)/3);   /* (container width − 2*gap) / 3 */
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06); /* now the border is included in the width */
  border-radius: 14px;
  overflow: hidden;
  min-height: 420px;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}

.GalleryItem:hover{   
  transform: translateY(-6px);
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}


.GalleryItem img{   /* images */
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}


.GalleryItem .card-body{    /* body */
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  font-family: 'Montserrat', sans-serif;
}
.GalleryItem .card-body h3{
  margin: 4px 0 2px;
  font-size: 20px;
  color: #0b486b;
}
.GalleryItem .card-body p{
  margin: 0;
  color: #333;
  line-height: 1.5;
  font-size: 15px;
}


.GalleryItem .btn{    /* the button is pressed down */
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #0b486b;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.GalleryItem .btn:hover{ background:#0e5c89; transform:translateY(-2px); }
.GalleryItem .btn:focus-visible{
  outline: 3px solid rgba(11,72,107,.35);
  outline-offset: 2px;
}


/* Task 4 background */
:root { --page-bg: #ffffff; }            /* default white */
html { background: var(--page-bg); }          /* apply to html */
html, body { transition: background-color .25s ease, color .25s ease; }


/* button style*/
.bg-btn{
  margin-left: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #ffffff66;
  background: #ffffff1a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.bg-btn:hover{ background:#ffffff2a; transform: translateY(-1px); }

/* === Popup base === */
.popup-overlay[hidden]{ display:none !important; }
.popup-overlay{
  position:fixed; inset:0; z-index:9999;
  display:grid; place-items:center;
  background:rgba(0,0,0,.55);
  padding:16px;
}
.popup{
  width:min(520px, 92vw);
  background:#fff; color:#111;
  border:1px solid #e5e7eb; border-radius:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  padding:18px;
  transform:translateY(8px); opacity:0;
  transition:transform .15s ease, opacity .15s ease;
  position:relative;
  font-family: 'Montserrat', sans-serif;
}
.popup-overlay.show .popup{ transform:translateY(0); opacity:1; }

/* close button */
.popup-close{
  position:absolute; top:10px; right:10px;
  border:0; background:transparent; font-size:28px; line-height:1; cursor:pointer;
}

/* form inside popup */
.popup-form{ display:grid; gap:12px; }
.popup-form label{ display:grid; gap:6px; font-weight:600; color:#334155; }
.popup-form input, .popup-form textarea{
  padding:10px 12px; border:1px solid #cbd5e1; border-radius:10px; font:inherit;
}
.popup-form input:focus, .popup-form textarea:focus{
  outline:none; border-color:#0b486b; box-shadow:0 0 0 3px rgba(11,72,107,.15);
}
.error{ display:none; color:#b91c1c; font-size:12.5px; font-weight:500; }

/* buttons */
.actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:6px; }
.actions .primary{
  background:#0b486b; color:#fff; border:0; border-radius:10px; padding:10px 14px; cursor:pointer;
}
.actions button{
  background:#fff; color:#0b486b; border:1px solid #0b486b; border-radius:10px; padding:10px 14px; cursor:pointer;
}

@media (prefers-reduced-motion: reduce){
  .popup{ transition:none; }
}

/* Read More button  */
#readMoreBtn {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #0b486b;       
  color: #fff;              
  border: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background .25s ease, transform .15s ease, box-shadow .15s ease;
}

#readMoreBtn:hover {  /* hover effect */
  background: #0e5c89;       
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

#readMoreBtn:focus-visible {  /* focus effect */
  outline: 3px solid rgba(11,72,107,.35);
  outline-offset: 2px;
}

/*  Phones */
@media (max-width: 560px) {
  .headerAktobe {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .InfoContainer {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .Gallery {
    flex-direction: column;
  }

  .GalleryItem {
    flex: 1 1 100%;
    max-width: 100%;
  }

  iframe {
    height: 350px;
  }

  .contact-form {
    padding: 0 10px;
  }
}

/*  Tablets */
@media (min-width: 561px) and (max-width: 1100px) {
  .GalleryItem {
    flex: 0 1 calc((100% - 20px) / 2);
  }

  .InfoContainer {
    flex-wrap: wrap;
    gap: 20px;
  }
}


/* DARK MODE Button*/
.theme-btn {
  padding: 8px 14px;
  border: 1px solid #ffffff66;
  border-radius: 8px;
  background: #ffffff1a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .2s;
  align-self: center;
  margin: 0;
}
.theme-btn:hover {
  background: #ffffff2a;
  transform: translateY(-2px);
}

/*  DARK MODE */
body.dark-mode {
  background-color: #0f172a;
  color: #f8fafc;
}

body.dark-mode .headerAktobe {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
}

body.dark-mode .main-nav a {
  color: #f8fafc;
}
body.dark-mode .main-nav a:hover {
  background: rgba(255,255,255,0.12);
}


body.dark-mode .InfoContainer {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
body.dark-mode .InfoContainer i {
  color: #60a5fa; 
}
body.dark-mode .InfoContainer h2 {
  color: #e2e8f0;
}
body.dark-mode .InfoContainer p {
  color: #cbd5e1;
}


body.dark-mode .Description,
body.dark-mode .LeftBankDescription,
body.dark-mode .RightBankDescription,
body.dark-mode .CultureDescription,
body.dark-mode .EventsDescription {
  color: #f1f5f9;
}


body.dark-mode h2,
body.dark-mode h3 {
  color: #60a5fa; 
}


body.dark-mode .GalleryItem {
  background-color: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
body.dark-mode .GalleryItem h3 {
  color: #93c5fd;
}
body.dark-mode .GalleryItem p {
  color: #e2e8f0;
}


body.dark-mode .bg-btn,
body.dark-mode .GalleryItem .btn {
  background: #2563eb; 
  color: #fff;
  border: none;
}
body.dark-mode .bg-btn:hover,
body.dark-mode .GalleryItem .btn:hover {
  background: #1d4ed8;
}


body.dark-mode .theme-btn {
  border: 1px solid #475569;
  background: #1e293b;
  color: #f8fafc;
}
body.dark-mode .theme-btn:hover {
  background: #334155;
}


body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #475569;
}
body.dark-mode .contact-form button {
  background: #2563eb;
  color: #fff;
}
body.dark-mode .contact-form button:hover {
  background: #1d4ed8;
}


body.dark-mode .footer02 {
  background: #1e293b;
  color: #f1f5f9;
}
body.dark-mode #github02 {
  color: #60a5fa;
}
body.dark-mode #github02:hover {
  color: #93c5fd;
}

/* Smooth transitions for all elements */
* {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
