:root {
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  /* Radius */
  --radius: 4px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
}

.ad-wrapper {
	margin: 1rem auto;
	text-align: center;
}

a {
  text-decoration: none;
  color: var(--color-accent);
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: none;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: bold;
  line-height: 1.3;
  margin: 0 0 1rem;
}

/* Header */
.site-header {
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-light);
}

.container-header {
  max-width: 768px;
  margin: 0 auto;
  padding: 1rem;
  gap: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  position: relative;
}

.logo img {
  height: 32px;
  width: auto;
  display: block;
}

.logo a {
  color: var(--color-heading);
  font-weight: bold;
  font-size: 1.5rem;
}

/* Navigation */
.nav-menu {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--color-heading);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0;
}

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

/* Search & Hamburger */
.search-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-toggle,
.hamburger {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-heading);
}

.search-toggle:hover,
.hamburger:hover {
  color: var(--color-accent);
}

.hamburger {
  font-size: 1.3rem;
  display: none;
}

.hamburger svg,
.search-toggle svg {
  display: block;
}

/* Search Form */
.search-form {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-background);
  padding: 0.75rem;
  border-top: 1px solid var(--color-border-dark);
  box-shadow: var(--shadow-strong);
  z-index: 1001;
  margin-right: 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.search-form input {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius);
  background-color: var(--color-background);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(21, 88, 214, 0.25);
}


.search-form input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.search-form.active {
  display: block;
}

/* Overlay */
#menuOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
}

#menuOverlay.active {
  display: block;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-background);
  border: 1px solid var(--color-border-dark);
  padding: 0.5rem 0;
  min-width: 160px;
  box-shadow: var(--shadow-medium);
  display: none;
  flex-direction: column;
  z-index: 1001;
  border-radius: var(--radius);
}

.dropdown-menu a {
  padding: 0.5rem 1rem;
  display: block;
  color: var(--color-text);
  font-size: 0.9rem;
}

.dropdown-menu a:hover {
  background: var(--color-nav-hover);
  color: var(--color-accent);
}

.dropdown:hover .dropdown-menu {
  display: flex;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-background);
    padding: 1rem;
    width: 100%;
    z-index: 1001;
    border-top: 1px solid var(--color-border-dark);
    box-shadow: var(--shadow-medium);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu a {
    padding: 0.75rem 0;
  }

  .search-form {
    left: 0;
    right: 0;
    width: 100%;
    padding: 10px;
    margin: 0;
    background-color: var(--color-background);
  }

  .search-form input[type="text"] {
    width: 100%;
  }

  .hamburger {
    display: block;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    background: var(--color-nav-hover);
    margin-top: 0.5rem;
  }

  .dropdown-menu a {
    padding-left: 1.5rem;
    font-size: 0.85rem;
  }

  .dropdown.open .dropdown-menu {
    display: flex;
  }

  .dropdown:hover .dropdown-menu {
    display: none;
  }
}

/* Main Layout */
.container {
  max-width: 768px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.main-article-wrapper {
  display: grid;
  gap: 1rem;
}

/* News */
.news-container {
  display: block;
}

.news-item {
  display: flex;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
}

.news-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  flex-shrink: 0;
  background-color: #eee;
  transition: opacity 0.3s ease;
}

.news-content {
  flex: 1;
}

.news-title {
  font-size: 1rem;
  margin: 10px 0;
}

.news-title a {
  color: var(--color-heading);
  transition: color 0.3s ease;
}

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

.news-category-main {
  margin-top: 0.5rem;
}

.news-category {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* Main Article */
.main-article {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.main-article img {
  width: 100%;
	height: auto;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: #eee;
}

/* Layout Responsive Desktop */
@media (min-width: 768px) {
  .main-article-wrapper {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 1rem;
  }

  .main-article {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .main-article .news-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .main-article .news-title {
    flex-grow: 1;
  }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.pagination a,
.pagination .current {
  padding: 0.5rem 0.75rem;
  background: var(--color-background-alt);
  border: 1px solid var(--color-border-dark);
  color: var(--color-heading);
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.pagination a:hover {
  background: var(--color-border);
  transform: translateY(-1px);
}


.pagination .current {
  background: var(--color-accent);
  color: #fff;
  font-weight: bold;
  border-color: var(--color-accent);
}

/* Footer */
.site-footer {
  background: var(--color-background-alt);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  color: var(--color-muted);
}

.container-footer {
  max-width: 768px;
  margin: 0 auto;
  text-align: center;
}

.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.footer-menu li {
  display: inline-block;
}

.footer-menu a {
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-menu a:hover {
  text-decoration: underline;
  color: var(--color-accent-hover);
}

/* Optional: spacing for vertical footer on small screens */
@media (max-width: 600px) {
  .footer-menu {
    align-items: center;
    gap: 0.5rem;
  }
}


/* Single Post */
.single-post {
  max-width: 768px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.post-header {
  margin: 1.5rem auto;
}

.post-header .category {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-header .title {
  font-size: 2rem;
  font-weight: bold;
  margin: 0.5rem 0;
  line-height: 1.3;
  color: var(--color-heading);
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 1rem auto;
}

.post-content a, .post-meta a {
	text-decoration: underline;
}

.post-featured-image {
  margin: 1rem auto;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}

.post-content {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

.post-content > * {
  margin: 1rem auto;
}

.post-content p {
  margin: 1rem auto;
}

.post-content h2 {
  font-size: 1.5rem;
  color: var(--color-heading);
  line-height: 1.3;
  margin: 1rem auto;
}

.post-content h3 {
  font-size: 1.3rem;
  color: var(--color-heading);
  line-height: 1.3;
  margin: 1rem auto;
}

.post-content h4 {
  font-size: 1.1rem;
  color: var(--color-heading);
  line-height: 1.3;
  margin: 1rem auto;
}

/* Archive */
.archive-header {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

.archive-title {
  font-size: 1.5rem;
  color: var(--color-heading);
}

.archive-description {
  font-size: 1rem;
}

/* Utility */
.text-center {
  text-align: center;
}

.no-posts {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-muted);
}

.no-posts h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-heading);
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.post-tags {
  padding: 1rem 0;
	font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.post-tags a {
  color: var(--color-accent);
}

.post-tags a:hover {
  text-decoration: underline;
  color: var(--color-accent-hover);
}

.hamburger svg,
.search-toggle svg {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--color-heading);
}

.hamburger:hover svg,
.search-toggle:hover svg {
  color: var(--color-accent);
}

@media (prefers-color-scheme: dark) {
  .logo img {
    filter: brightness(0) saturate(100%) invert(1);
  }
}

.loader-ellips {
  font-size: 12px; /* change size here */
  position: relative;
  width: 4em;
  height: 1em;
  margin: 10px auto;
}

.loader-ellips__dot {
  display: block;
  width: 1em;
  height: 1em;
  border-radius: 0.5em;
  background: #1558d60f;
  position: absolute;
  animation-duration: 0.5s;
  animation-timing-function: ease;
  animation-iteration-count: infinite;
}

.loader-ellips__dot:nth-child(1),
.loader-ellips__dot:nth-child(2) {
  left: 0;
}
.loader-ellips__dot:nth-child(3) { left: 1.5em; }
.loader-ellips__dot:nth-child(4) { left: 3em; }

@keyframes reveal {
  from { transform: scale(0.001); }
  to { transform: scale(1); }
}

@keyframes slide {
  to { transform: translateX(1.5em) }
}

.loader-ellips__dot:nth-child(1) {
  animation-name: reveal;
}

.loader-ellips__dot:nth-child(2),
.loader-ellips__dot:nth-child(3) {
  animation-name: slide;
}

.loader-ellips__dot:nth-child(4) {
  animation-name: reveal;
  animation-direction: reverse;
}
