/* ==========================================================================
   Kartom Paper — WordPress integration styles
   ========================================================================== */

/* Header search
   ========================================================================== */
.header-search {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.header-search[hidden] { display: none; }
.header-search .search { max-width: 100%; margin: 0; }

/* Admin bar offset
   ========================================================================== */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* Featured main wrapper
   ========================================================================== */
.featured__main { min-width: 0; }
.featured__main .post-card { height: 100%; }

/* About badge icon
   ========================================================================== */
.about__badge .icon { color: var(--yellow); }

/* WordPress screen reader text
   ========================================================================== */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: #fff;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, .6);
  clip: auto !important;
  clip-path: none;
  color: var(--red);
  display: block;
  font-size: 14px;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Archive and blog
   ========================================================================== */
.archive-header {
  max-width: 860px;
  padding: 40px 0 32px;
}
.archive-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 600;
  margin: 14px 0 10px;
}
.archive-description {
  color: var(--muted);
  font-size: 16px;
  max-width: 720px;
}
.archive-description p { margin: 0; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
.post-grid .post-card { height: 100%; }
.empty-state {
  max-width: 720px;
  margin: 0 auto 64px;
  padding: 40px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.empty-state h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 10px;
}
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.empty-state .search { margin-inline: auto; }

/* Pagination
   ========================================================================== */
.pagination { margin: 10px 0 56px; }
.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* Page content
   ========================================================================== */
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding-bottom: 76px;
}
.page-content .article__header { padding-top: 22px; }
.page-content .content { margin-top: 8px; }
.page-content .article__hero { margin-top: 8px; }
.page-links {
  margin-top: 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.page-links a { margin-left: 6px; }

/* 404
   ========================================================================== */
.error-404 {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 0 96px;
  text-align: center;
}
.error-404__code {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(88px, 16vw, 150px);
  line-height: .9;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: -.06em;
}
.error-404__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.08;
  font-weight: 600;
  margin: 18px 0 12px;
}
.error-404__text { color: var(--muted); margin-bottom: 24px; }
.error-404 .search { margin-inline: auto; }
.error-404__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

/* Tags
   ========================================================================== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  font-size: 12px;
  color: var(--muted);
}
.tags a {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 600;
}
.tags a:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }

/* Copy link feedback
   ========================================================================== */
.share__btn.is-copied { background: var(--green); border-color: var(--green); color: #073b2a; }

/* Mobile nav fallback
   ========================================================================== */
.mobile-nav .nav__list { list-style: none; padding: 12px 24px 24px; }
.mobile-nav .nav__list li { border-bottom: 1px solid var(--line); }
.mobile-nav .nav__list a { display: block; padding: 14px 0; font-weight: 600; color: var(--ink); }

/* Nav dropdowns
   ========================================================================== */
.nav__list li { position: relative; }
.nav__list .sub-menu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: none;
  z-index: 60;
}
.nav__list li:hover > .sub-menu,
.nav__list li:focus-within > .sub-menu { display: block; }
.nav__list .sub-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
}
.nav__list .sub-menu a:hover { background: var(--red-soft); color: var(--red); }

/* Gutenberg: lead paragraph
   ========================================================================== */
.is-style-lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Gutenberg: buttons
   ========================================================================== */
.wp-block-buttons { gap: 10px; }
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.wp-block-button__link:hover {
  background: var(--red-dark);
  color: #fff;
  transform: translateY(-1px);
}
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--red);
  color: #fff;
}

/* Gutenberg: images and media
   ========================================================================== */
.wp-block-image { margin: 28px 0; }
.wp-block-image img { border-radius: var(--radius); }
.wp-block-image figcaption,
.wp-block-embed figcaption,
.wp-block-table figcaption,
.wp-caption-text {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}
.wp-block-media-text { margin: 28px 0; }
.wp-block-media-text img { border-radius: var(--radius); }
.alignleft { float: left; margin: 0 24px 18px 0; }
.alignright { float: right; margin: 0 0 18px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.gallery-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .alignleft,
  .alignright { float: none; margin: 0 auto 18px; }
}
.wp-block-cover { border-radius: var(--radius); overflow: hidden; }
.wp-block-embed { margin: 28px 0; }
.wp-block-embed iframe { border-radius: var(--radius); }

/* Gutenberg: tables
   ========================================================================== */
.wp-block-table { margin: 28px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.wp-block-table table { margin: 0; border: 0; min-width: 560px; }
.wp-block-table th,
.wp-block-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.wp-block-table th { background: var(--cream); }
.wp-block-table tr:last-child td { border-bottom: 0; }
.wp-block-table figcaption { padding: 10px 14px; margin: 0; }

/* Gutenberg: quotes, details, separators
   ========================================================================== */
.wp-block-quote {
  margin: 28px 0;
  padding: 22px 26px;
  border-left: 4px solid var(--yellow);
  background: var(--yellow-soft);
  border-radius: 0 12px 12px 0;
}
.wp-block-quote p { margin: 0; }
.wp-block-quote cite { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.wp-block-details {
  margin: 10px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.wp-block-details summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  list-style: none;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
  content: "+";
  float: right;
  color: var(--red);
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
}
.wp-block-details[open] summary::after { content: "−"; }
.wp-block-details > *:not(summary) { padding: 0 20px 18px; }
.wp-block-details p { margin: 0; }
.wp-block-separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 36px auto;
  max-width: 120px;
}

/* Gutenberg: groups and columns
   ========================================================================== */
.wp-block-group { margin: 0; }
.wp-block-group.callout { padding: 20px 22px; }
.wp-block-group.callout p { margin: 0; }
.wp-block-columns { gap: 24px; }
.wp-block-column > *:first-child { margin-top: 0; }
.wp-block-column > *:last-child { margin-bottom: 0; }

/* Gutenberg: lists, code, files, social
   ========================================================================== */
.wp-block-list { padding-left: 24px; }
.wp-block-list li::marker { color: var(--red); }
.wp-block-code,
pre.wp-block-code {
  background: var(--ink);
  color: #f5efe6;
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13.5px;
}
.wp-block-file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wp-block-file .wp-block-file__button {
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 700;
}
.wp-block-social-links { gap: 8px; }
.wp-block-social-links .wp-social-link a { color: inherit; }

/* Gutenberg: latest posts, categories, archives, tag cloud
   ========================================================================== */
.wp-block-latest-posts,
.wp-block-categories,
.wp-block-archives {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}
.wp-block-latest-posts li,
.wp-block-categories li,
.wp-block-archives li { font-size: 14px; }
.wp-block-latest-posts a,
.wp-block-categories a,
.wp-block-archives a { color: var(--ink-soft); font-weight: 600; }
.wp-block-latest-posts a:hover,
.wp-block-categories a:hover,
.wp-block-archives a:hover { color: var(--red); }
.wp-block-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-block-tag-cloud a {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px !important;
  color: var(--ink-soft);
  text-decoration: none;
}
.wp-block-tag-cloud a:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }

/* Gutenberg: search
   ========================================================================== */
.wp-block-search__inside-wrapper {
  display: flex;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 7px 7px 18px;
}
.wp-block-search__input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  min-width: 0;
}
.wp-block-search__button {
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
}

/* Gutenberg: captions and galleries
   ========================================================================== */
.wp-caption { max-width: 100%; }
.wp-caption img { border-radius: var(--radius); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.gallery-item { margin: 0; }
.gallery-item img { border-radius: 10px; }

/* Widgets
   ========================================================================== */
.widget { margin-bottom: 20px; }
.widget:last-child { margin-bottom: 0; }
.widget ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.widget li { font-size: 14px; }
.widget a { color: var(--ink-soft); font-weight: 600; }
.widget a:hover { color: var(--red); }
.widget select,
.widget input[type="search"],
.widget input[type="text"],
.widget input[type="email"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font-size: 14px;
}
.footer-widget { margin-bottom: 24px; }

/* Shortcode newsletter forms
   ========================================================================== */
.newsletter__form-wrap input[type="email"],
.newsletter__form-wrap input[type="text"] {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  margin-bottom: 10px;
}
.newsletter__form-wrap button,
.newsletter__form-wrap input[type="submit"] {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
}

/* Sticky and author classes
   ========================================================================== */
.sticky { display: block; }
.bypostauthor { display: block; }

/* Responsive
   ========================================================================== */
@media (max-width: 920px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .post-grid { grid-template-columns: 1fr; }
  .archive-header { padding-top: 26px; }
  .error-404 { padding-top: 48px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .page-content { padding-bottom: 48px; }
  .error-404__actions .btn { width: 100%; }
  .gallery { grid-template-columns: 1fr; }
}
