:root {
  --bg:#ffffff;
  --text:#0b1a2a;
  --muted:#5b6b7d;
  --brand:#0d3b66;
  --brand2:#0056b3;
  --border:#e6edf4;
  --card:#f7fafc;
  --chip:#e9f1fb;
}

*{box-sizing:border-box;}
html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,Segoe UI,Arial,sans-serif;
  overflow-x: hidden;
  width: 100%;
}
a{color:var(--brand2);text-decoration:none;}
a:hover{text-decoration:underline;}

.container{
  max-width:1100px;
  margin:0 auto;
  padding:16px;
}

/* --- TOP BAR --- */
.topbar{
  border-bottom:1px solid var(--border);
  background:#fdfefe;
}
.topbar .bar-inner{
  display:flex;
  align-items:center;
  gap:16px;
}
.brand .banner{
  height:44px;
}
.topbar .town-name {
  margin: 0;
  font-size: 1.2rem;
  color: var(--brand);
}
.search{
  margin-left:auto;
  width:420px;
  max-width:50%;
}
.search input{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
}

/* --- TABS --- */
.tabs{
  border-bottom:1px solid var(--border);
  background:#f6fbff;
  position: relative;
}
.tabs-container{
  display:flex;
  align-items: center;
  gap:10px;
  padding:10px 16px;
  position: relative;
}
.tabs-visible {
  display: flex;
  gap: 10px;
  flex: 1;
  flex-wrap: nowrap;
  overflow: visible;
}
.tabs a, .tab-item{
  padding:8px 12px;
  border-radius:999px;
  background:var(--chip);
  color:var(--brand);
  font-weight:500;
  white-space: nowrap;
  text-decoration: none;
}
.tabs a.active, .tab-item.active{
  background:var(--brand);
  color:#fff;
}
.tabs a:hover, .tab-item:hover{
  text-decoration: none;
}

/* --- HERO --- */
.hero-wrapper {
  position: relative;
  width: 80vw;
  left: 50%;
  right: 50%;
  margin-left: -25vw;
  margin-right: -50vw;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 400px;
  max-height: 600px;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0px hidden;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-text {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  padding: 20px 45px;
  border-radius: 40px;
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  white-space: nowrap;
}

/* --- CARDS & CONTENT --- */
.card{
  background:#fff;
  padding: 10px;
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  margin-top:16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.card h2{
  margin:0;
  padding:16px;
  border-bottom:1px solid var(--border);
  color:var(--brand);
}
.card .content{padding:16px;}

.grid{
  display:grid;
  grid-template-columns:1fr 320px;
  gap:20px;
}

.list-tiles{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px;
}
.tile{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  text-align:center;
  transition:0.2s;
}
.tile a{
  color:var(--brand2);
  text-decoration:none;
  font-weight:500;
}
.tile:hover{
  background:var(--brand);
}
.tile:hover a{
  color:#fff;
}

.badge{
  display:inline-block;
  background:var(--chip);
  padding:4px 8px;
  border-radius:999px;
  color:var(--brand);
  font-size:12px;
}

/* --- SIDEBAR --- */
.sidebar .panel{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  margin-bottom:16px;
}
.right-rail-ad{
  border:1px dashed var(--border);
  border-radius:12px;
  padding:8px;
  text-align:center;
}

/* Mobile sidebar - hidden by default */
.mobile-sidebar {
  display: none;
}

/* Desktop sidebar always visible */
.desktop-only {
  display: block;
}

/* --- FOOTER --- */
.footer, .site-footer{
  margin-top:26px;
  padding:16px 0;
  border-top:1px solid var(--border);
  color:var(--muted);
  text-align:center;
  font-size:0.95rem;
}

.hero-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:20px;
  text-align:center;
  margin-bottom:20px;
}
.hero-card .hero-img{
  max-width:40px;
  margin-bottom:15px;
}

/* --- ADS --- */
.ad-horizontal{
  margin:30px 0;
  text-align:center;
}
.ad-vertical{
  margin-top:20px;
  text-align:center;
  position:sticky;
  top:120px;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px){
  /* Make grid single column on tablets/mobile */
  .grid{
    grid-template-columns:1fr;
  }
  
  /* Hide desktop sidebar */
  .desktop-only {
    display: none !important;
  }
  
  /* Show mobile sidebar */
  .mobile-sidebar {
    display: block !important;
    margin: 20px 0;
  }
  
  .ad-vertical{
    position:static;
  }
  
  .hero-slider {
    height: 40vh;
    min-height: 280px;
  }
  
  .hero-text {
    font-size: 1.4rem;
    padding: 12px 24px;
    white-space: normal;
  }
  
  .hero-wrapper {
    width: 100vw;
    margin-left: -50vw;
    margin-right: -50vw;
  }
}

@media (max-width: 768px) {
  /* Mobile topbar - keep logo and town name in one line */
  .topbar .bar-inner {
    flex-wrap: wrap;
  }
  
  .brand {
    order: 1;
    flex: 0 0 auto;
  }
  
  .brand .banner {
    height: 32px;
  }
  
  .topbar .town-name {
    order: 2;
    font-size: 0.85rem;
    flex: 1;
  }
  
  .search {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 8px 0 0 0;
  }
  
  /* Mobile tabs - keep horizontal with overflow button */
  .tabs-container {
    gap: 8px;
    padding: 10px 12px;
  }
  
  .tabs-visible {
    gap: 8px;
  }
  
  .tabs .tab-item, .tabs a {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  
  /* Adjust list tiles for mobile */
  .list-tiles {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }
  
  .container {
    padding: 12px;
  }
}