/* Magazine (mag) styles — based on 2026 SEO article designs */

.mag-main {
  padding-bottom: 40px;
}

.single-mag main.site-main {
  padding-bottom: 0;
}

/* Fixed header offset for TOC / in-page anchors */
html {
  scroll-padding-top: 140px;
}

@media screen and (max-width: 781px) {
  html {
    scroll-padding-top: 100px;
  }
}

.mag-page-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 0 20px;
}

.mag-page-header .page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.mag-container {
  margin: 0 auto;
  padding: 40px 32px 64px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  max-width: 982px;
}

/* Filters */
.mag-filters {
  margin-bottom: 40px;
}

.mag-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.mag-filter-tab {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  background: #fff;
  color: #1f2023;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid #cfcfcf;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.mag-filter-tab:hover {
  background: #f7f7f7;
  color: #1f2023;
}

.mag-filter-tab.is-active {
  background: #1f5c4a;
  border-color: #1f5c4a;
  color: #fff;
}

.mag-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
}

.mag-tag-cloud__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2023;
  padding-top: 4px;
}

.mag-tag-cloud__icon {
  display: inline-block;
  width: 16px;
  height: 13px;
  flex-shrink: 0;
  background: url(../img/icon_tag.svg) center / contain no-repeat;
}

.mag-tag-cloud__list,
.mag-single-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.mag-tag-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), #BFE8B3;
  color: #55555d;
  text-decoration: none;
  font-size: 0.8125rem;
  transition: background-color 0.2s, color 0.2s;
}

.mag-tag-pill:hover,
.mag-tag-pill.is-active {
  background: #4de878;
  color: #1f2023;
  border-color: #4de878;
}

/* Sections */
.mag-section {
  margin-bottom: 56px;
}

.mag-section__title,
.mag-list-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2023;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom-width: 2px;
  border-bottom-style: solid;
  border-image: linear-gradient(2.3deg, #2376D0, #25ACCA 43%, #20CD7A) 5;
  mask: linear-gradient(white, white);
}

.mag-section__icon {
  display: inline-block;
  width: 20px;
  height: 23.5px;
  flex-shrink: 0;
  background: url(../img/Subtract.png) center / contain no-repeat;
}

.mag-list-header {
  margin-bottom: 8px;
}

.mag-section__more {
  margin-top: 32px;
  text-align: center;
}

.mag-more-btn {
  display: inline-block;
  min-width: 320px;
  max-width: 100%;
  padding: 16px 28px;
  background-color: #4DE878;
  color: #1f2023;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 0.2s, color 0.2s;
}

.mag-more-btn:hover,
.mag-more-btn:focus-visible {
  background-color: #44C167;
  color: #1f2023;
}

/* Card grid */
.mag-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.mag-card {
  margin: 0;
  background: #fff;
  border: 0;
  box-shadow: none;
  overflow: visible;
  border-radius: 0 0 4px 4px;
}

.mag-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.mag-card__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 16px;
}

.mag-card__thumb {
  aspect-ratio: 310 / 174;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  margin-bottom: 16px;
}

.mag-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.mag-card__thumb img.mag-card__thumb-fallback {
  object-fit: contain;
  object-position: center;
  box-sizing: border-box;
}

.mag-card__link:hover .mag-card__thumb img {
  transform: scale(1.04);
}

.mag-card__link:hover .mag-card__thumb img.mag-card__thumb-fallback {
  transform: none;
}

.mag-card__thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: #2a2a2a;
}

.mag-card__category,
.mag-category {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  padding: 4px 12px;
  border-radius: 9999px;
  background: #FFFFFF;
  color: #27292D;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mag-card__category {
  margin-bottom: 10px;
}

.mag-card__category::before,
.mag-category::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 3px solid transparent;
  background: linear-gradient(84deg, #2376D0, #25ACCA 43%, #20CD7A) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0) border-box;
  -webkit-mask-composite: destination-out;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0) border-box;
  mask-composite: exclude;
  pointer-events: none;
}

.mag-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: #1f2023;
  margin: 0 0 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mag-card__date {
  display: block;
  margin-top: auto;
  text-align: right;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #9a9a9a;
}

.mag-empty {
  text-align: center;
  color: #666;
  padding: 40px 0;
}

/* Pagination */
.mag-container .navigation.pagination {
  display: flex;
  justify-content: flex-end;
  margin: 40px 32px 0 0;
}

.mag-container .navigation.pagination ul.page-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mag-container .navigation.pagination ul.page-numbers > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mag-container .navigation.pagination ul.page-numbers > li > .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 3px;
  background-color: transparent;
  color: #1F2023;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1;
}

.mag-container .navigation.pagination ul.page-numbers > li > .page-numbers.current {
  background-color: #1F2023;
  color: #fff;
}

.mag-container .navigation.pagination ul.page-numbers > li > a.page-numbers:visited {
  color: #1F2023;
}

.mag-container .navigation.pagination ul.page-numbers > li > a.page-numbers:hover,
.mag-container .navigation.pagination ul.page-numbers > li > a.page-numbers:focus-visible {
  background-color: #4DE878;
  color: #1F2023;
}

/* Single */
.single-mag .breadcrumbs,
.post-type-archive-mag .breadcrumbs,
.tax-mag_category .breadcrumbs,
.tax-mag_tag .breadcrumbs {
  max-width: 1080px;
  margin: 16px auto;
  padding: 0 24px;
  font-size: 0.875rem;
  color: #fff;
}

.single-mag .breadcrumbs a,
.post-type-archive-mag .breadcrumbs a,
.tax-mag_category .breadcrumbs a,
.tax-mag_tag .breadcrumbs a {
  color: #fff;
}

.mag-single {
  margin: 0 auto;
  padding: 32px 40px 48px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  max-width: 896px;
}

.mag-list-link {
  margin-bottom: 20px;
}

.mag-list-link a {
  color: #55555d;
  text-decoration: none;
  font-size: 0.875rem;
}

.mag-list-link a::before {
  content: '← ';
}

.mag-list-link a:hover {
  color: #1f2023;
}

.mag-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.mag-date {
  font-size: 0.875rem;
  color: #888;
}

.mag-single .entry-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 15px 0 0;
  line-height: 1.4;
  color: #263943;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #2376D0, #25ACCA 43%, #20CD7A) 5;
}

.mag-featured-image {
  margin-bottom: 28px;
}

.mag-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.mag-featured-image--fallback {
  background: #1f2023;
  border-radius: 8px;
  overflow: hidden;
}

.mag-featured-image--fallback img.mag-featured-image__fallback {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  object-position: center;
  padding: 48px 24px;
  box-sizing: border-box;
}

.mag-single .entry-content {
  font-size: 16px;
  line-height: 1.9;
  color: #333;
}

.mag-single .entry-content p {
  margin-bottom: 1.25em;
}

.mag-single .entry-content mark {
  background: transparent;
}

.mag-single .entry-content img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
}

.mag-single h2 {
  margin: 2em 0 1em;
  padding-left: 10px;
  border-left-width: 16px;
  border-left-style: solid;
  border-radius: 8px;
  border-image: linear-gradient(2.3deg, #25ACCA, #20CD7A) 5;
  mask: linear-gradient(white, white);
  font-size: 1.5rem;
  background-color: white;
  scroll-margin-top: 140px;
}

@media screen and (max-width: 781px) {
  .mag-single h2 {
    scroll-margin-top: 100px;
  }
}

.mag-single h3 {
  margin: 1.75em 0 0.75em;
  padding-left: 10px;
  border-left-width: 4px;
  border-left-style: solid;
  border-right-width: 4px;
  border-right-style: solid;
  border-image: linear-gradient(2.3deg, #2376D0, #25ACCA 43%, #20CD7A) 5;
  font-size: 1.25rem;
  background-color: white;
}

/* TOC */
.mag-toc {
  margin: 28px 0;
  padding: 20px 24px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #fafafa;
}

.mag-toc__title {
  font-weight: 700;
  margin: 0 0 12px;
  font-size: 1rem;
}

.mag-toc__list {
  margin: 0;
  padding-left: 1.25em;
}

.mag-toc__list li {
  margin-bottom: 6px;
}

.mag-toc__list a {
  color: #1f2023;
  text-decoration: none;
}

.mag-toc__list a:hover {
  color: #20cd7a;
  text-decoration: underline;
}

/* Single tags */
.mag-single-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e5;
}

.mag-single-tags__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1f2023;
}

/* Footer nav */
.mag-nav-link {
  margin: 16px 24px 220px;
}

.mag-footer-link {
  margin: 0 auto;
  padding: 28px 30px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  max-width: 896px;
}

.mag-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mag-navigation a {
  color: #1f2023;
  text-decoration: none;
}

.mag-navigation a:hover {
  color: #55555d;
}

.nav-separator {
  color: #999;
}

.mag-archive-link {
  text-align: center;
}

.mag-archive-link a {
  display: inline-block;
  min-width: 280px;
  padding: 10px 20px;
  background-color: #1f2023;
  color: #c6c6c6;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
  transition: background-color 0.2s, color 0.2s;
}

.mag-archive-link a::before {
  content: '← ';
}

.mag-archive-link a:hover {
  color: #fff;
  background-color: #383840;
}

/* Responsive */
@media screen and (max-width: 900px) {
  .mag-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 600px) {
  .mag-container {
    padding: 24px 16px 40px;
    border-radius: 12px;
  }

  .mag-card-grid {
    grid-template-columns: 1fr;
  }

  .mag-single {
    padding: 24px 16px 36px;
    border-radius: 12px;
  }

  .mag-page-header .page-title {
    font-size: 1.75rem;
  }

  .mag-more-btn,
  .mag-archive-link a {
    min-width: auto;
    width: 100%;
  }

  .mag-filter-tabs {
    gap: 8px;
  }

  .mag-filter-tab {
    padding: 8px 12px;
    font-size: 0.8125rem;
  }
}

