/*
 * Theme: meinbezirks (SmartMag-derived)
 * CSS: css/style.css
 *
 * Sections:
 * 1. CSS Variables & Reset
 * 2. Typography & Global
 * 3. Layout & Container
 * 4. Navigation
 * 5. Off-Canvas Mobile Menu
 * 6. Breadcrumb
 * 7. Article Cards (grid-post, small-post, list-post)
 * 8. Block Heads & Sections
 * 9. Homepage Layouts
 * 10. Category Page
 * 11. Article Detail Page
 * 12. Sidebar
 * 13. Pagination
 * 14. Footer
 * 15. Static Pages & 404
 * 16. Responsive
 */

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
:root {
  --c-main: #2ab391;
  --c-main-rgb: 42, 179, 145;
  --body-font: "Public Sans", system-ui, sans-serif;
  --text-size: 14px;
  --text-lh: 1.714;
  --main-width: 1200px;
  --grid-gutter: 30px;
  --wrap-padding: 20px;
  --sidebar-width: 33.3333%;
  --c-contrast-0: #fff;
  --c-contrast-50: #f7f7f7;
  --c-contrast-75: #efefef;
  --c-contrast-100: #e8e8e8;
  --c-contrast-200: #ccc;
  --c-contrast-400: #999;
  --c-contrast-450: #8a8a8a;
  --c-contrast-500: #777;
  --c-contrast-600: #666;
  --c-contrast-700: #444;
  --c-contrast-800: #333;
  --c-contrast-900: #161616;
  --c-links: #161616;
  --c-headings: #161616;
  --c-excerpts: #505050;
  --c-post-meta: #8a8a8a;
  --c-separator: #e8e8e8;
  --footer-bg: #0f0f11;
  --footer-lower-bg: #040404;
  --post-content-size: 1rem;
  --post-content-lh: 1.75;
  --title-size-xs: 13px;
  --title-size-s: 15px;
  --title-size-n: 18px;
  --title-size-m: 20px;
  --title-size-l: 24px;
  --title-size-xl: 30px;
}

html, body, div, span, h1, h2, h3, h4, h5, h6,
p, blockquote, a, abbr, em, img, ins,
dl, dt, dd, ol, ul, li, fieldset, form, label,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, figure, figcaption, footer, header, nav, section {
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: baseline;
  font-size: 100%;
  font-family: inherit;
}

article, aside, figcaption, figure, footer, header, nav, section {
  display: block;
}

ol, ul { list-style: none; }

table { border-collapse: collapse; border-spacing: 0; }

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

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

a img { border: 0; }

button, input[type="submit"] { cursor: pointer; -webkit-appearance: none; }

/* ==========================================================================
   2. Typography & Global
   ========================================================================== */
body {
  font-family: var(--body-font);
  font-size: var(--text-size);
  line-height: var(--text-lh);
  color: var(--c-contrast-700);
  background: var(--c-contrast-0);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--body-font);
  color: var(--c-headings);
  font-weight: 700;
  line-height: 1.3;
}

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

a:hover {
  color: var(--c-main);
}

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* Global focus */
:focus-visible {
  outline: 2px solid var(--c-main);
  outline-offset: 2px;
}

/* Visuallyhidden (accessibility) */
.visuallyhidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   3. Layout & Container
   ========================================================================== */
.main-wrap {
  position: relative;
  overflow-x: hidden;
}

.ts-contain,
.wrap {
  max-width: var(--main-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--wrap-padding);
  padding-right: var(--wrap-padding);
}

.ts-row {
  display: flex;
  gap: var(--grid-gutter);
  align-items: flex-start;
}

.col-8 {
  flex: 0 0 calc(66.6667% - var(--grid-gutter) / 2);
  min-width: 0;
}

.col-4 {
  flex: 0 0 calc(33.3333% - var(--grid-gutter) / 2);
  min-width: 0;
}

.cf::after { content: ""; display: table; clear: both; }

/* ==========================================================================
   4. Navigation
   ========================================================================== */
.smart-head {
  background: #fff;
  border-bottom: 1px solid var(--c-separator);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s;
}

.smart-head.is-stuck {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.smart-head-row {
  padding: 0;
}

.smart-head-mid .inner {
  display: flex;
  align-items: center;
  height: 70px;
  gap: 24px;
}

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

.items-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.items-center {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-link .logo-image {
  height: 40px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--c-main);
  text-transform: uppercase;
}

.logo-text span {
  color: var(--c-contrast-900);
}

.nav-wrap {
  display: flex;
  align-items: center;
}

.navigation ul {
  display: flex;
  align-items: center;
  gap: 0;
}

.navigation ul li a {
  display: block;
  padding: 0 14px;
  height: 70px;
  line-height: 70px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-contrast-900);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.navigation ul li a:hover,
.navigation ul li.current-menu-item a {
  color: var(--c-main);
  border-bottom-color: var(--c-main);
}

/* Social icons in nav */
.spc-social-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spc-social .link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--c-contrast-500);
  font-size: 14px;
  transition: color 0.2s;
}

.spc-social .link:hover { color: var(--c-main); }

/* Search icon & hamburger */
.search-icon,
.offcanvas-toggle {
  background: none;
  border: none;
  padding: 6px 8px;
  color: var(--c-contrast-700);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.search-icon:hover,
.offcanvas-toggle:hover { color: var(--c-main); }

/* Hamburger icon */
.hamburger-icon {
  display: inline-flex;
  vertical-align: middle;
  height: 17px;
  width: 22px;
  position: relative;
}

.hamburger-icon .inner,
.hamburger-icon .inner::before,
.hamburger-icon .inner::after {
  position: absolute;
  height: 2px;
  background: currentColor;
  transition: background 0.2s ease-in-out, transform 0.3s ease-in-out;
}

.hamburger-icon .inner {
  bottom: 0;
  /* 6px shorter than top/bottom bars for a staggered-width look */
  width: calc(100% - 6px);
}

.hamburger-icon .inner::before,
.hamburger-icon .inner::after {
  display: block;
  content: "";
  width: calc(100% + 6px);
}

.hamburger-icon .inner::before {
  top: 0;
  transform: translateY(calc(-17px + 100%));
}

.hamburger-icon .inner::after {
  bottom: 0;
  transform: translateY(calc(-17px / 2 + 50%));
}

/* Mobile nav (hidden on desktop) */
.smart-head-mobile { display: none; }

/* ==========================================================================
   5. Off-Canvas Mobile Menu
   ========================================================================== */
.off-canvas-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1100;
}

.off-canvas-backdrop.is-active { display: block; }

.mobile-menu-container {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background: #1a1a1e;
  z-index: 1200;
  overflow-y: auto;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-menu-container.is-open { right: 0; }

.off-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.off-canvas-head .close {
  color: #fff;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.off-canvas-head .close:hover { color: var(--c-main); }

.off-canvas-content {
  padding: 20px;
  flex: 1;
}

.mobile-menu {
  display: flex;
  flex-direction: column;
}

.mobile-menu li a {
  display: block;
  padding: 12px 0;
  color: #e0e0e0;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: color 0.2s;
}

.mobile-menu li a:hover { color: var(--c-main); }

/* Logo inside mobile menu */
.ts-logo .logo-text {
  font-size: 18px;
}

/* ==========================================================================
   6. Breadcrumb
   ========================================================================== */
.breadcrumbs {
  background: var(--c-contrast-50);
  border-bottom: 1px solid var(--c-separator);
  padding: 10px 0;
}

.breadcrumbs .inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--c-contrast-450);
}

.breadcrumbs a {
  color: var(--c-contrast-600);
}

.breadcrumbs a:hover { color: var(--c-main); }

.breadcrumbs .sep {
  margin: 0 4px;
  color: var(--c-contrast-400);
}

.breadcrumbs .breadcrumb_last {
  color: var(--c-contrast-500);
}

/* ==========================================================================
   7. Article Cards
   ========================================================================== */

/* --- Media / Image --- */
.l-post .media {
  position: relative;
  overflow: hidden;
}

.image-link {
  display: block;
  overflow: hidden;
}

.media-ratio {
  position: relative;
  overflow: hidden;
}

.ratio-16-9 { padding-bottom: 56.25%; }
.ratio-3-2  { padding-bottom: 66.6667%; }
.ar-bunyad-thumb { padding-bottom: 75%; }

.media-ratio .img,
.media-ratio img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.l-post:hover .media-ratio .img,
.l-post:hover .media-ratio img,
.hover-zoom:hover .media-ratio .img {
  transform: scale(1.05);
}

/* Category overlay badge */
.cat-labels-overlay {
  position: absolute;
  z-index: 5;
}

.cat-labels-overlay.p-bot-left {
  bottom: 10px;
  left: 10px;
}

.cat-labels a,
.category {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--c-main);
  color: #fff;
  border-radius: 2px;
  line-height: 1.6;
}

.cat-labels a:hover { background: #228f74; color: #fff; }

/* Post meta */
.post-meta { }

.is-title.post-title {
  font-weight: 700;
  line-height: 1.3;
}

.is-title a { color: var(--c-headings); }
.is-title a:hover { color: var(--c-main); }

.post-meta-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--c-post-meta);
}

.meta-above { margin-bottom: 6px; }
.meta-below { margin-top: 6px; }

.meta-item.date,
.meta-item.post-author { font-size: 12px; }

.meta-item.post-author .by { margin-right: 3px; }

/* --- grid-post (featured grid + category grid) --- */
.grid-post .content {
  padding: 12px 0 0;
}

.grid-post .is-title {
  font-size: var(--title-size-n);
  margin-bottom: 6px;
}

/* Grid overlay (feat-grid items) */
.grid-overlay .media-ratio {
  /* already has padding for ratio */
}

.grid-overlay .content-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
}

.grid-overlay .content-wrap .is-title {
  font-size: var(--title-size-m);
  color: #fff;
  margin-bottom: 4px;
}

.grid-overlay .content-wrap .is-title a { color: #fff; }
.grid-overlay .content-wrap .is-title a:hover { color: var(--c-main); }

.grid-overlay .content-wrap .post-meta-items { color: rgba(255,255,255,0.7); }

.grid-overlay .media {
  position: relative;
}

.grid-overlay .media > .image-link {
  display: block;
}

/* --- small-post (sidebar + footer small list) --- */
.small-post {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-separator);
}

.small-post:last-child { border-bottom: 0; }

.small-post .media {
  flex: 0 0 90px;
  width: 90px;
}

.small-post .media .image-link {
  display: block;
}

.small-post .media .media-ratio {
  padding-bottom: 75%;
}

.small-post .content {
  flex: 1;
  min-width: 0;
}

.small-post .is-title {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
}

/* --- list-post (homepage list section) --- */
.list-post {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--c-separator);
}

.list-post:last-child { border-bottom: 0; }

.list-post .media {
  flex: 0 0 200px;
  width: 200px;
}

.list-post .content {
  flex: 1;
  min-width: 0;
}

.list-post .is-title {
  font-size: var(--title-size-m);
  margin-bottom: 8px;
}

.list-post .excerpt {
  font-size: 14px;
  color: var(--c-excerpts);
  line-height: 1.6;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-main);
}

.read-more-link:hover { text-decoration: underline; }

/* ==========================================================================
   8. Block Heads & Sections
   ========================================================================== */
.block-wrap {
  margin-bottom: 40px;
}

.block-wrap.mb-none { margin-bottom: 0; }
.block-wrap.mb-md { margin-bottom: 30px; }

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--c-separator);
}

.block-head.is-left {
  justify-content: flex-start;
}

.block-head.block-head-i {
  border-left: 3px solid var(--c-main);
  padding-left: 10px;
  border-bottom: none;
  padding-bottom: 0;
}

.block-head.block-head-c {
  border-bottom: 1px solid var(--c-separator);
  padding-bottom: 10px;
}

.block-head .heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-headings);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.block-head .heading .color { color: var(--c-main); }

/* ==========================================================================
   9. Homepage Layouts
   ========================================================================== */
.main-full { }

/* Featured Grid */
.feat-grid {
  position: relative;
}

.feat-grid .items-wrap {
  display: grid;
  grid-template-columns: 60% 20% 20%;
  grid-template-rows: auto auto;
  gap: 4px;
  min-height: 400px;
}

.feat-grid .item-large { grid-column: 1; grid-row: 1 / 3; }
.feat-grid .item-2 { grid-column: 2 / 4; grid-row: 1; }
.feat-grid .item-3 { grid-column: 2; grid-row: 2; }
.feat-grid .item-4 { grid-column: 3; grid-row: 2; }

.feat-grid .item-medium,
.feat-grid .item-small {
  /* explicitly placed via item-2/3/4 classes */
}

.feat-grid .item {
  position: relative;
  overflow: hidden;
}

.feat-grid .l-post {
  height: 100%;
}

.feat-grid .l-post .media {
  height: 100%;
}

.feat-grid .l-post .image-link {
  height: 100%;
  display: block;
}

.feat-grid .l-post .media-ratio {
  padding-bottom: 0;
  height: 100%;
  min-height: 200px;
}

.feat-grid .item-large .media-ratio { min-height: 400px; }

/* 3-small grid across */
.loop-small.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gutter);
}

.loop-small.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gutter);
}

.loop-small.grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* Main grid (category grid) */
.loop-grid.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gutter);
}

.loop-grid.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gutter);
}

.loop-grid.grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* List loop */
.loop-list.grid-1 {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Homepage two-column section */
.home-two-col {
  padding: 40px 0;
  background: var(--c-contrast-0);
}

.home-sections {
  padding: 30px 0;
}

/* Featured header section (feat-grid wrapper) */
.feat-grid-section {
  background: var(--c-contrast-0);
  padding: 0;
}

/* Small posts strip */
.small-strip {
  padding: 20px 0;
  background: var(--c-contrast-50);
  border-top: 1px solid var(--c-separator);
  border-bottom: 1px solid var(--c-separator);
}

/* Browsing header for category */
.browsing-head {
  padding: 20px 0;
  border-bottom: 3px solid var(--c-main);
  margin-bottom: 0;
}

.browsing-head h1 {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.browsing-head h1 span {
  color: var(--c-main);
}

/* ==========================================================================
   10. Category Page
   ========================================================================== */
.main {
  padding: 30px 0 40px;
}

.main-content { }

/* Category grid posts */
.loop-grid.cat-loop .grid-post {
  display: flex;
  flex-direction: column;
}

.loop-grid.cat-loop .grid-post .media { margin-bottom: 0; }

.loop-grid.cat-loop .grid-post .content {
  padding: 12px 0 0;
  flex: 1;
}

.loop-grid.cat-loop .grid-post .is-title {
  font-size: var(--title-size-n);
  margin-bottom: 6px;
}

.loop-grid.cat-loop .grid-post .excerpt {
  font-size: 13px;
  color: var(--c-excerpts);
  line-height: 1.6;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   11. Article Detail Page
   ========================================================================== */
.single-post-wrap {
  padding: 30px 0 40px;
}

.post-hero .post-meta-single {
  margin-bottom: 24px;
}

.post-meta-single .is-title {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.25;
  margin: 12px 0;
}

.post-meta-single .meta-above { margin-bottom: 8px; }

.post-content {
  font-size: var(--post-content-size);
  line-height: var(--post-content-lh);
  color: var(--c-contrast-700);
}

.post-content h2 {
  font-size: 20px;
  margin: 1.6em 0 0.6em;
  color: var(--c-headings);
}

.post-content h3 {
  font-size: 17px;
  margin: 1.4em 0 0.5em;
  color: var(--c-headings);
}

.post-content p { margin-bottom: 1.2em; }

.post-content ul, .post-content ol {
  margin: 0.8em 0 1.2em 1.5em;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li { margin-bottom: 0.4em; }

.post-content blockquote {
  border-left: 4px solid var(--c-main);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--c-contrast-50);
  font-style: italic;
}

.post-content img {
  border-radius: 4px;
  margin: 1em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 14px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.post-content th,
.post-content td {
  border: 1px solid var(--c-separator);
  padding: 10px 14px;
  text-align: left;
}

.post-content th {
  background: var(--c-main);
  color: #fff;
  font-weight: 700;
  border-color: var(--c-main);
}

.post-content tbody tr:nth-child(even) {
  background: var(--c-contrast-50);
}

.post-content tbody tr:hover {
  background: var(--c-contrast-75);
}

/* Author box */
.author-box {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--c-contrast-50);
  border-radius: 4px;
  margin-top: 32px;
  border: 1px solid var(--c-separator);
}

.author-box .author-avatar img {
  border-radius: 50%;
  width: 60px;
  height: 60px;
}

.author-box .author-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

/* FAQ Section */
.faq-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--c-separator);
}

.faq-section h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.faq-item {
  border: 1px solid var(--c-separator);
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--c-contrast-50);
  transition: background 0.2s;
  user-select: none;
}

.faq-question:hover { background: var(--c-contrast-75); }

.faq-question h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-headings);
  margin: 0;
}

.faq-toggle {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--c-main);
  transition: transform 0.3s;
  font-style: normal;
}

.faq-item.is-open .faq-toggle { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-contrast-700);
  border-top: 1px solid var(--c-separator);
}

.faq-item.is-open .faq-answer { display: block; }

/* ==========================================================================
   12. Sidebar
   ========================================================================== */
.main-sidebar {
  padding-left: 10px;
  border-left: 1px solid var(--c-separator);
}

.main-sidebar .widget {
  margin-bottom: 32px;
}

.main-sidebar .widget:last-child { margin-bottom: 0; }

/* ==========================================================================
   13. Pagination
   ========================================================================== */
.main-pagination {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--c-separator);
}

.main-pagination .inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.main-pagination a,
.main-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--c-separator);
  color: var(--c-contrast-700);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border-radius: 2px;
}

.main-pagination a:hover {
  background: var(--c-main);
  color: #fff;
  border-color: var(--c-main);
}

.main-pagination .current,
.main-pagination span.current {
  background: var(--c-main);
  color: #fff;
  border-color: var(--c-main);
}

.main-pagination .dots {
  border: none;
  color: var(--c-contrast-400);
  background: none;
}

/* ==========================================================================
   14. Footer
   ========================================================================== */
.main-footer {
  margin-top: 0;
}

.upper-footer {
  background: var(--footer-bg);
  padding: 48px 0 36px;
}

.upper-footer .widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gutter);
}

.upper-footer .widget-title .heading {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--c-main);
  margin-bottom: 16px;
  display: inline-block;
}

.upper-footer .about-text {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin-top: 12px;
}

.upper-footer .image-logo img {
  height: 36px;
  width: auto;
  margin-bottom: 10px;
}

/* Footer small posts */
.upper-footer .small-post {
  border-bottom-color: rgba(255,255,255,0.1);
}

.upper-footer .small-post .is-title a { color: rgba(255,255,255,0.85); }
.upper-footer .small-post .is-title a:hover { color: var(--c-main); }
.upper-footer .small-post .post-meta-items { color: rgba(255,255,255,0.45); }

.lower-footer {
  background: var(--footer-lower-bg);
  padding: 14px 0;
}

.lower-footer .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.lower-footer .copyright {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.lower-footer .links ul {
  display: flex;
  gap: 16px;
}

.lower-footer .links a {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.lower-footer .links a:hover { color: var(--c-main); }

/* ==========================================================================
   15. Static Pages & 404
   ========================================================================== */
.page-content-wrap {
  padding: 40px 0 60px;
}

.page-content h2 {
  font-size: 20px;
  margin: 1.5em 0 0.6em;
}

.page-content h3 {
  font-size: 17px;
  margin: 1.3em 0 0.5em;
}

.page-content p { margin-bottom: 1.1em; line-height: 1.75; }

.page-content ul { list-style: disc; margin: 0.8em 0 1em 1.5em; }
.page-content ol { list-style: decimal; margin: 0.8em 0 1em 1.5em; }

.page-title {
  font-size: clamp(22px, 3vw, 32px);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--c-separator);
}

/* 404 */
.error-404-wrap {
  padding: 80px 0;
  text-align: center;
}

.error-404-wrap h1 {
  font-size: clamp(30px, 5vw, 56px);
  margin-bottom: 12px;
  color: var(--c-headings);
}

.error-404-wrap .error-code {
  font-size: 120px;
  font-weight: 900;
  color: var(--c-main);
  line-height: 1;
  margin-bottom: 20px;
}

.error-404-wrap p {
  font-size: 16px;
  color: var(--c-contrast-500);
  max-width: 480px;
  margin: 0 auto 12px;
  line-height: 1.7;
}

.btn-home {
  display: inline-block;
  padding: 12px 28px;
  background: var(--c-main);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 3px;
  margin-top: 20px;
  transition: background 0.2s;
}

.btn-home:hover { background: #228f74; color: #fff; }
.btn-home:active { background: #1a7a62; }

.error-categories {
  margin-top: 48px;
  border-top: 1px solid var(--c-separator);
  padding-top: 32px;
}

.error-categories h2 {
  font-size: 16px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.error-cat-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.error-cat-list a {
  padding: 6px 16px;
  border: 1px solid var(--c-separator);
  border-radius: 3px;
  font-size: 13px;
  color: var(--c-contrast-700);
  transition: background 0.2s, color 0.2s;
}

.error-cat-list a:hover {
  background: var(--c-main);
  color: #fff;
  border-color: var(--c-main);
}

/* Search modal */
.search-modal-wrap {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.search-modal-wrap.is-open { display: flex; }

.search-modal-box {
  width: 100%;
  max-width: 580px;
  padding: 20px;
}

.search-form {
  position: relative;
}

.search-field {
  width: 100%;
  padding: 14px 18px;
  font-size: 18px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  color: #fff;
  outline: none;
}

.search-field::placeholder { color: rgba(255,255,255,0.5); }
.search-field:focus { border-color: var(--c-main); }

.search-form .message {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  margin-top: 10px;
  margin-bottom: 0;
}

/* ==========================================================================
   16. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --main-width: 100%;
    --wrap-padding: 16px;
  }

  .feat-grid .items-wrap {
    grid-template-columns: 55% 22.5% 22.5%;
  }

  .loop-small.grid-3 { grid-template-columns: repeat(2, 1fr); }
  .loop-grid.grid-3 { grid-template-columns: repeat(2, 1fr); }

  /* Stack category/article detail columns for centered layout */
  .ts-row { flex-direction: column; gap: 0; }
  .col-8, .col-4 { flex: none; width: 100%; }

  .main-sidebar {
    border-left: none;
    border-top: 1px solid var(--c-separator);
    padding-left: 0;
    padding-top: 30px;
    margin-top: 30px;
  }
}

@media (max-width: 768px) {
  /* Switch to mobile nav */
  .smart-head-main { display: none; }
  .smart-head-mobile { display: block; }
  .smart-head-mobile .smart-head-row .inner { height: 56px; }

  /* Center logo in mobile nav header */
  .smart-head-mobile .items-left,
  .smart-head-mobile .items-right {
    flex: 1;
  }
  .smart-head-mobile .items-center {
    flex: none;
  }

  .feat-grid .items-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .feat-grid .item-large { grid-column: auto; grid-row: auto; }
  .feat-grid .item-2 { grid-column: auto; grid-row: auto; }
  .feat-grid .item-3 { grid-column: auto; grid-row: auto; }
  .feat-grid .item-4 { grid-column: auto; grid-row: auto; }
  .feat-grid .l-post .media-ratio { min-height: 220px; height: auto; padding-bottom: 56.25%; }
  .feat-grid .item-large .media-ratio { min-height: 0; }

  .loop-small.grid-3 { grid-template-columns: 1fr; }
  .loop-small.grid-2 { grid-template-columns: 1fr; }
  .loop-grid.grid-3 { grid-template-columns: repeat(2, 1fr); }
  .loop-grid.grid-2 { grid-template-columns: 1fr; }

  .list-post { flex-direction: column; }
  .list-post .media { width: 100%; flex: none; }

  .upper-footer .widgets { grid-template-columns: 1fr; gap: 28px; }

  .lower-footer .inner { flex-direction: column; text-align: center; }
  .lower-footer .links ul { flex-wrap: wrap; justify-content: center; }

  /* Article detail: add breathing room on left/right */
  .main-content { padding-left: 15px; padding-right: 15px; }
}

@media (max-width: 480px) {
  .loop-grid.grid-3 { grid-template-columns: 1fr; }
  .error-404-wrap .error-code { font-size: 80px; }
}
