body {
  margin: 0;
  font-family: Arial, sans-serif;
}

/* =========================================================
   Main header: logo + search + categories + Home on one row
   ========================================================= */
.header {
  padding: 0;
  background: #fff;
  border-top: 2px solid #10152f;
  border-bottom: 4px solid #10152f;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 66px;
  padding: 8px 30px;
  background: #fff;
}

.logo {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
}

.search-box {
  flex: 1 1 420px;
  min-width: 240px;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 40px 10px 20px;
  border-radius: 50px;
  border: 2px solid #aaa;
  font-size: 14px;
}

.search-box button {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  width: 30px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #444;
}

.menu {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
  min-width: 0;
  margin-left: auto;
  white-space: nowrap;
}

.menu a,
.menu .menu-item > a {
  margin: 0;
  padding: 22px 0;
  text-decoration: none;
  color: #2c3037;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
}

.menu > li,
.menu .menu-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a:hover,
.menu a:focus-visible,
.menu .current-menu-item > a {
  color: #0d6efd;
  text-decoration: none;
}

.menu .worksheet-category-link-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 22px 0;
  color: #2c3037;
  font-size: 14px;
  white-space: nowrap;
}

.menu .worksheet-category-link-inline.is-active,
.menu .worksheet-category-link-inline:hover,
.menu .worksheet-category-link-inline:focus-visible {
  color: #0d6efd;
}

.menu .worksheet-category-link-inline.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  height: 2px;
  background: currentColor;
}

@media (max-width: 1199px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 20px;
  }

  .logo {
    order: 1;
  }

  .search-box {
    order: 2;
    max-width: none;
  }

  .menu {
    order: 3;
    flex: 0 0 100%;
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu a,
  .menu .menu-item > a,
  .menu .worksheet-category-link-inline {
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .menu .worksheet-category-link-inline.is-active::after {
    bottom: 4px;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 8px 14px;
  }

  .logo {
    font-size: 17px;
  }

  .search-box {
    flex-basis: 100%;
    order: 3;
  }

  .menu {
    order: 2;
    flex-basis: auto;
    margin-left: auto;
    max-width: 58vw;
  }
}
.content-later {
	width: 550px;
	float: right;
	margin-top: 20px;
}

.content img {
	width: 500px;
}

.list-horizontal {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	list-style: none;
	padding: 0;
	margin: 0;
	justify-content: center;
}

.list-horizontal li {
	width: 150px;
	text-align: center;
}

.list-horizontal img {
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.list-horizontal .title {
	margin-top: 8px;
	font-weight: bold;
	font-size: 16px;
	color: #333;
}
  .grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 40px auto;
    font-family: Arial, sans-serif;
  }

  .grid-list h3 {
    font-size: 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .grid-list ul {
    padding-left: 20px;
    margin: 0;
  }

  .grid-list ul li {
    list-style: disc;
    margin-bottom: 6px;
    font-size: 15px;
  }
@media (max-width: 600px) {
  .list-horizontal li {
    width: 100%;
  }
}

/* =========================================================
   Primary worksheet category navigation
   Math / English / Word Lists / Calculators / Unit Converter
   ========================================================= */
.worksheet-category-nav {
  display: none; /* v7: primary categories now live in the main header row */
}

.worksheet-category-nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 56px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.worksheet-category-nav-inner::-webkit-scrollbar {
  display: none;
}

.worksheet-category-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 21px;
  color: #282d35;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease;
}

.worksheet-category-link:first-child {
  padding-left: 0;
  padding-right: 21px;
}

.worksheet-category-link:hover,
.worksheet-category-link:focus-visible,
.worksheet-category-link.is-active {
  color: #0d6efd;
  text-decoration: none;
}

.worksheet-category-link.is-active::after {
  content: "";
  position: absolute;
  left: 21px;
  right: 21px;
  bottom: -1px;
  height: 2px;
  background: currentColor;
}

.worksheet-category-link:first-child.is-active::after {
  left: 0;
}

/* Category archive */
.worksheet-category-page {
  background: #f8f9fa;
}

.worksheet-category-header {
  margin: 8px 0 28px;
}

.worksheet-category-header h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  color: #20242a;
}

.worksheet-category-description {
  max-width: 760px;
  color: #636b75;
  font-size: 16px;
  line-height: 1.65;
}

.worksheet-category-description p:last-child {
  margin-bottom: 0;
}

.worksheet-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.worksheet-category-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  box-shadow: 0 3px 14px rgba(0,0,0,.045);
  transition: transform .18s ease, box-shadow .18s ease;
}

.worksheet-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.worksheet-category-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef2f6;
  text-decoration: none;
}

.worksheet-category-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.worksheet-category-card-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #8a929c;
  font-weight: 600;
}

.worksheet-category-card-body {
  padding: 18px 20px 20px;
}

.worksheet-category-card-type {
  margin-bottom: 7px;
  color: #6d7580;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.worksheet-category-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.3;
}

.worksheet-category-card h2 a {
  color: #20242a;
  text-decoration: none;
}

.worksheet-category-card h2 a:hover {
  color: #0d6efd;
}

.worksheet-category-card-excerpt {
  color: #626a74;
  font-size: 14px;
  line-height: 1.55;
}

.worksheet-category-card-excerpt p:last-child {
  margin-bottom: 0;
}

.worksheet-category-pagination {
  margin-top: 32px;
}

.worksheet-category-empty {
  padding: 30px;
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 12px;
}

@media (max-width: 991px) {
  .worksheet-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .worksheet-category-nav-inner {
    min-height: 50px;
  }

  .worksheet-category-link {
    min-height: 50px;
    padding-left: 15px;
    padding-right: 15px;
    font-size: 14px;
  }

  .worksheet-category-link:first-child {
    padding-left: 0;
    padding-right: 15px;
  }

  .worksheet-category-link.is-active::after {
    left: 15px;
    right: 15px;
  }

  .worksheet-category-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* =========================================================
   Math child-category grid (v5)
   ========================================================= */
.worksheet-subcategory-section {
  margin: 0 0 36px;
}

.worksheet-subcategory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 12px;
  max-width: 820px;
}

.worksheet-subcategory-card {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 9px 11px;
  background: #fbfbfb;
  border: 1px solid #e5e7ea;
  border-radius: 2px;
  box-shadow: 2px 3px 0 rgba(0,0,0,.045);
  color: #20242a;
  text-align: center;
  text-decoration: none;
  line-height: 1.15;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.worksheet-subcategory-card:hover,
.worksheet-subcategory-card:focus-visible {
  background: #fff;
  border-color: #cfd5dc;
  box-shadow: 2px 4px 10px rgba(0,0,0,.08);
  color: #0d6efd;
  text-decoration: none;
  transform: translateY(-1px);
}

.worksheet-subcategory-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.worksheet-subcategory-name {
  display: block;
  max-width: 150px;
  font-size: 12px;
  font-weight: 400;
}

.worksheet-category-latest-title {
  margin: 40px 0 20px;
  font-size: 25px;
  line-height: 1.25;
  color: #20242a;
}

.worksheet-category-parent-link {
  display: inline-block;
  margin-bottom: 10px;
  color: #68717b;
  font-size: 14px;
  text-decoration: none;
}

.worksheet-category-parent-link:hover {
  color: #0d6efd;
  text-decoration: none;
}

@media (max-width: 767px) {
  .worksheet-subcategory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    gap: 10px;
  }

  .worksheet-subcategory-card {
    min-height: 86px;
  }
}

@media (max-width: 380px) {
  .worksheet-subcategory-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Addition preset archive groups (v12)
   ========================================================= */
.worksheet-addition-groups {
  max-width: 820px;
}

.worksheet-addition-group {
  margin: 0 0 58px;
}

.worksheet-addition-group-title {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.3;
  color: #20242a;
  font-weight: 700;
}

.worksheet-addition-post-grid {
  margin-bottom: 0;
}

.worksheet-addition-post-card .worksheet-subcategory-name {
  max-width: 160px;
}

@media (max-width: 767px) {
  .worksheet-addition-group {
    margin-bottom: 36px;
  }

  .worksheet-addition-group-title {
    font-size: 15px;
  }
}


/* =========================================================
   Addition with Pictures preset archive groups (v13)
   ========================================================= */
.worksheet-addition-pictures-groups{max-width:820px}
.worksheet-picture-level{margin:0 0 62px}
.worksheet-picture-level-title{margin:0 0 6px;font-size:18px;line-height:1.3;color:#20242a;font-weight:700}
.worksheet-picture-level-description{margin:0 0 20px;max-width:720px;color:#5f6872;font-size:13px;line-height:1.5}
.worksheet-picture-set-group{margin:0 0 30px}
.worksheet-picture-set-title{margin:0 0 12px;font-size:15px;line-height:1.3;color:#20242a;font-weight:600}
@media(max-width:767px){.worksheet-picture-level{margin-bottom:42px}.worksheet-picture-set-group{margin-bottom:24px}}
