/*
Theme Name: iOS Dev Tools
Author: Edward Team
Author URI: https://meetedward.com/
Description: A clean block theme for a curated iOS developer tools directory: tools, guides and reviews.
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: those-who-swift
Tags: blog, block-patterns, full-site-editing, wide-blocks, custom-logo, featured-images
*/

:root {
  /* Neutrals — cool, faintly indigo-tinted to harmonise with the brand purple */
  --tws-ink: #1e1b2e;          /* body text / near-black */
  --tws-surface: #f6f6fb;      /* Mist — page canvas behind white cards */
  --tws-soft: #edecf8;         /* Lavender — subtle fills, inputs, ad wells */
  --tws-border: #e5e4ef;       /* Line — hairline dividers & card edges */
  --tws-border-strong: #d6d5e6;/* stronger dashed/placeholder borders */
  --tws-muted: #6c6b81;        /* secondary text */
  /* Darks for the inverted banner + footer */
  --tws-dark: #171522;         /* Ink Dark — newsletter band & footer */
  --tws-dark-2: #201e30;       /* elevated dark surface */
  --tws-dark-3: #100f19;       /* deepest — footer badge / bottom bar */
  /* Brand */
  --tws-accent: #665ee8;       /* Purple — primary brand */
  --tws-accent-strong: #4f46d6;/* Purple Deep — hover / active */
  --tws-accent-soft: #eae8fc;  /* Purple Tint — badges, soft fills */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { text-underline-offset: 0.18em; }
img { max-width: 100%; height: auto; }

/* Sticky footer: keep the footer at the bottom on short pages */
.wp-site-blocks {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Subtract the admin bar so logged-in users don't get a permanent scrollbar */
body.admin-bar .wp-site-blocks { min-height: calc(100vh - 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar .wp-site-blocks { min-height: calc(100vh - 46px); }
}
.wp-site-blocks > main { flex: 1 0 auto; }
.wp-site-blocks > footer { flex-shrink: 0; }
.tws-site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--tws-border);
  position: relative;
  z-index: 10;
}
.tws-header-inner {
  min-height: 74px;
  gap: 28px;
}
.tws-brand { gap: 10px; }
.tws-brand .wp-block-site-logo { margin: 0; line-height: 0; }
.tws-brand .wp-block-site-logo img {
  border-radius: 0;
  display: block;
  width: auto;
  max-height: 46px;
}
/* The logo is the full "iOS DEV TOOLS" wordmark, so the separate title is hidden */
.tws-brand .wp-block-site-title { display: none; }
.tws-main-nav a {
  color: var(--tws-muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 140ms ease;
}
.tws-main-nav a:hover,
.tws-main-nav .current-menu-item > a { color: var(--tws-accent); }
.tws-main-nav .wp-block-navigation__responsive-container-open { color: var(--wp--preset--color--foreground); }
.tws-main-nav .wp-block-navigation__container { gap: 30px; }
.tws-header-actions { gap: 14px; }
.tws-header-cta .wp-block-button__link {
  white-space: nowrap;
  background: var(--tws-accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.92rem;
  transition: background 140ms ease, transform 100ms ease;
}
.tws-header-cta .wp-block-button__link:hover { background: var(--tws-accent-strong); }
.tws-header-cta .wp-block-button__link:active { transform: translateY(1px); }
.tws-header-actions .tws-social { gap: 2px; margin: 0 6px 0 0; }
.tws-header-actions .tws-social .wp-social-link {
  padding: 6px;
  color: var(--wp--preset--color--foreground);
  opacity: 0.66;
  transition: opacity 140ms ease, transform 140ms ease;
}
.tws-header-actions .tws-social .wp-social-link:hover { opacity: 1; transform: translateY(-1px); }
.tws-header-actions .tws-social .wp-social-link svg { width: 19px; height: 19px; }

.tws-main { margin-top: 0; padding-top: 0; padding-bottom: 64px; }
.tws-view-all { margin-top: 36px; }
.tws-view-all .wp-block-button__link { min-width: 180px; text-align: center; }

/* Banner ad placeholders — a row of three, aligned to the post grid */
.tws-ad-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 26px;
  margin-top: 44px;
  margin-bottom: 44px;
}
/* Zero WP block-gap margins so every grid cell is equal height (WP adds a top
   margin to non-first children, which otherwise makes the first ad taller). */
.tws-ad-row > * { margin: 0; }
.tws-ad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 190px;
  margin: 0;
  padding: 24px;
  text-align: center;
  background: var(--tws-accent-soft);
  border: 1px dashed #c4bdf1;
  border-radius: 14px;
  transition: border-color 140ms ease, background 140ms ease;
}
.tws-ad:hover { border-color: var(--tws-accent); background: #e3e0fb; }
.tws-ad > * { margin: 0; }
.tws-ad-title {
  color: var(--tws-accent-strong);
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}
.tws-ad-note {
  color: var(--tws-accent-strong);
  font-size: 0.9rem;
  font-weight: 500;
}
/* Stretched link: one real anchor ANYWHERE inside .tws-ad covers the whole card,
   so the entire ad — including a Group with a background-image banner — is
   clickable while staying keyboard-focusable and editable. Keep exactly one link
   inside the ad group. */
.tws-ad a { color: inherit; text-decoration: none; }
.tws-ad a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
/* Drop the placeholder chrome when the ad holds a real banner: add the CSS class
   "is-banner" to the ad Group (block Advanced > Additional CSS class). An Image
   block inside then fills the slot edge-to-edge, and its own link (no text
   needed) makes the whole banner clickable. */
.tws-ad.is-banner { border: none; padding: 0; background: none; overflow: hidden; }
.tws-ad.is-banner .wp-block-image,
.tws-ad.is-banner figure,
.tws-ad.is-banner img { width: 100%; height: 100%; margin: 0; }
.tws-ad.is-banner img { object-fit: cover; display: block; border-radius: inherit; }

/* Custom "Ad Banner" block (tws/ad-banner): the whole block is a link with a
   background image; in its empty state it shows a placeholder. */
.tws-ad-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  border-radius: 14px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-decoration: none;
  color: var(--tws-accent-strong);
  transition: border-color 140ms ease, background-color 140ms ease;
}
.tws-ad-banner.is-empty {
  background-color: var(--tws-accent-soft);
  border: 1px dashed var(--tws-border);
}
a.tws-ad-banner:hover { border-color: var(--tws-accent); }
.tws-ad-banner__hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  text-align: center;
}
.tws-ad-banner__title {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  font-size: 1.06rem;
  color: var(--tws-accent-strong);
}
.tws-ad-banner__note { font-size: 0.9rem; font-weight: 500; color: var(--tws-accent-strong); }

@media (max-width: 960px) {
  .tws-ad-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .tws-ad-row { grid-template-columns: 1fr; }
}
.tws-newsletter-banner {
  background: var(--tws-dark);
  color: #fff;
  border-radius: 0;
  padding: clamp(52px, 7vw, 88px) 24px;
  text-align: center;
  margin-top: 0;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.tws-newsletter-banner h1,
.tws-newsletter-banner h2 {
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0;
}
.tws-newsletter-banner p {
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.5;
  max-width: 34rem;
  margin: 20px auto 0;
}
.tws-newsletter-banner .tws-signup { margin-top: 36px; }

/* Real Substack iframe embed (used on the light Newsletter page) */
.tws-substack-frame { max-width: 480px; margin: 10px 0 0; }
.tws-substack-frame iframe {
  width: 100%;
  min-height: 320px;
  border: none;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 50px -26px rgba(23, 21, 34, 0.30);
}

/* Newsletter landing (page-newsletter.html) */
.tws-center-content { display: flex; flex-direction: column; justify-content: center; }
.tws-newsletter-hero { gap: clamp(30px, 5vw, 68px); margin-top: 24px; width: 100%; }
.tws-newsletter-hero .tws-page-title { font-size: clamp(2.2rem, 4.6vw, 3.7rem); line-height: 1.02; }
.tws-newsletter-hero .tws-substack-frame { max-width: 100%; margin: 0; }
.tws-benefits { list-style: none; padding: 0; margin: 28px 0 0; }
.tws-benefits li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 15px;
  font-size: 1.04rem;
}
.tws-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  background: var(--tws-accent-soft);
  color: var(--tws-accent-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Inline email signup — reads correctly on both dark surfaces */
.tws-signup {
  width: min(100%, 520px);
  margin: 28px auto 0;
}
.tws-site-footer .tws-signup { margin: 16px 0 0; }
.tws-signup-row { display: flex; gap: 10px; }
.tws-signup-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 0.98rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tws-signup-input::placeholder { color: rgba(255, 255, 255, 0.45); }
.tws-signup-input:focus {
  outline: none;
  border-color: var(--tws-accent);
  box-shadow: 0 0 0 3px rgba(102, 94, 232, 0.28);
}
.tws-signup-btn {
  flex: 0 0 auto;
  background: var(--tws-accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 13px 24px;
  font-family: inherit;
  font-weight: 650;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 140ms ease, transform 100ms ease;
}
.tws-signup-btn:hover { background: var(--tws-accent-strong); }
.tws-signup-btn:active { transform: translateY(1px); }

/* Accessibility floor */
:where(a, button, input, .wp-block-button__link):focus-visible {
  outline: 2px solid var(--tws-accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

.featured-query .wp-block-post-template,
.post-grid .wp-block-post-template {
  margin: 0;
  padding: 0;
  list-style: none;
}
.featured-query .wp-block-post-template > li,
.post-grid .wp-block-post-template > li { margin: 0; }

.tws-featured-card {
  border: 1px solid var(--tws-border);
  background: #fff;
  min-height: 390px;
  border-radius: 20px;
}
.tws-featured-card > .wp-block-column { margin: 0; }
.tws-featured-image,
.tws-featured-image a { height: 100%; display: block; }
.tws-featured-image img {
  width: 100%;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
  border-radius: 20px 0 0 20px;
}
.tws-featured-copy {
  padding: clamp(28px, 4vw, 54px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tws-featured-copy .wp-block-post-title {
  margin: 10px 0 16px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.tws-featured-copy .wp-block-post-excerpt { color: var(--tws-muted); }
.tws-card-meta,
.tws-card-footer { gap: 14px; }
.tws-card-meta { color: var(--tws-muted); }
.tws-card-footer { margin-top: auto; padding-top: 22px; }
.tws-card-footer .wp-block-post-author { margin: 0; }
.tws-card-footer .wp-block-post-author__avatar img { border-radius: 50%; }
.tws-card-footer .wp-block-post-author__byline { display: none; }
.tws-card-footer .wp-block-post-author__name {
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--wp--preset--color--foreground);
}
.tws-card-footer .wp-block-read-more {
  color: var(--tws-accent);
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
  transition: color 140ms ease;
}
.tws-card-footer .wp-block-read-more:hover { color: var(--tws-accent-strong); }

.post-grid .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px !important;
}
.tws-post-card {
  height: 100%;
  border: 1px solid var(--tws-border);
  border-radius: 18px;
  padding: 16px 16px 22px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: box-shadow 220ms ease, transform 220ms ease, border-color 220ms ease;
}
/* The card is a constrained group; stop its auto-margins from centering short
   children (date, author/read footer) while long ones fill the width. */
.tws-post-card > * {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.tws-post-card:hover {
  border-color: #d3cff2;
  box-shadow: 0 18px 40px -22px rgba(80, 71, 214, 0.30);
  transform: translateY(-3px);
}
.tws-post-card .wp-block-post-featured-image {
  margin: 0 0 18px;
}
.tws-post-card .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}
.tws-post-card .wp-block-post-date { color: var(--tws-muted); font-size: 0.86rem; }
.tws-post-card .wp-block-post-title {
  margin: 16px 0 14px;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  line-height: 1.25;
}
.tws-post-card .wp-block-post-title a { text-decoration: none; }
.tws-post-card .wp-block-post-excerpt {
  color: var(--tws-muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.tws-pagination { margin-top: 34px; }
.tws-pagination a,
.tws-pagination .current {
  border: 1px solid var(--tws-border);
  border-radius: 8px;
  padding: 9px 13px;
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease;
}
.tws-pagination a:hover { border-color: var(--tws-accent); color: var(--tws-accent); }
.tws-pagination .current {
  background: var(--tws-accent);
  color: #fff;
  border-color: var(--tws-accent);
}

.tws-site-footer {
  background: var(--tws-dark);
  border-top: 1px dotted rgba(255, 255, 255, 0.22);
  padding-top: 64px;
  padding-bottom: 40px;
  color: rgba(255, 255, 255, 0.65);
}
.tws-footer-grid { align-items: flex-start !important; gap: 40px; }
.tws-site-footer h2,
.tws-site-footer h3 {
  font-family: var(--wp--preset--font-family--body);
  color: #fff;
  font-weight: 650;
  font-size: 1.05rem;
  margin-bottom: 18px;
}
.tws-site-footer ul { padding-left: 0; list-style: none; margin: 0; }
.tws-site-footer li { margin-bottom: 14px; }
.tws-site-footer a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 140ms ease;
}
.tws-site-footer a:hover { color: #9b93f5; text-decoration: none; }
.tws-footer-note { color: rgba(255, 255, 255, 0.5); margin-top: 12px; }
.tws-footer-bottom {
  margin-top: 72px;
  padding-top: 24px;
  color: rgba(255, 255, 255, 0.55);
}
.tws-footer-credit { gap: 5px; }
.tws-footer-credit p { margin: 0; }
.tws-footer-credit .wp-block-site-title,
.tws-footer-credit .wp-block-site-title a {
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
  color: #fff;
}
.tws-footer-badge {
  background: var(--tws-dark-3);
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
}
.tws-footer-badge a { color: #fff; text-decoration: none; }
.tws-footer-badge a:hover { color: #9b93f5; }

.tws-content-shell {
  padding-top: 54px;
  padding-bottom: 72px;
  --wp--style--global--content-size: 860px;
}

/* Search box (search results page) */
.tws-search-box { margin-bottom: 36px; }
.tws-search-box .wp-block-search__inside-wrapper {
  border: 1px solid var(--tws-border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  padding: 4px;
}
.tws-search-box .wp-block-search__input {
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 1rem;
}
.tws-search-box .wp-block-search__input:focus { outline: none; }
.tws-search-box .wp-block-search__button {
  background: var(--tws-accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 20px;
  font-weight: 650;
  cursor: pointer;
}
.tws-search-box .wp-block-search__button:hover { background: var(--tws-accent-strong); }

/* Contact / submission form */
.tws-form { max-width: 620px; margin-top: 8px; }
.tws-form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tws-form-row { display: flex; gap: 16px; }
.tws-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; flex: 1 1 auto; }
.tws-field span { font-weight: 600; font-size: 0.9rem; }
.tws-form input[type="text"],
.tws-form input[type="email"],
.tws-form input[type="url"],
.tws-form textarea {
  width: 100%;
  font: inherit;
  color: var(--wp--preset--color--foreground);
  background: #fff;
  border: 1px solid var(--tws-border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tws-form input:focus,
.tws-form textarea:focus {
  outline: none;
  border-color: var(--tws-accent);
  box-shadow: 0 0 0 3px rgba(102, 94, 232, 0.16);
}
.tws-form textarea { resize: vertical; min-height: 140px; }
.tws-form-submit {
  background: var(--tws-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 26px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background 140ms ease, transform 100ms ease;
}
.tws-form-submit:hover { background: var(--tws-accent-strong); }
.tws-form-submit:active { transform: translateY(1px); }
.tws-form-notice {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 22px;
  font-weight: 550;
}
.tws-form-notice--ok { background: var(--tws-accent-soft); color: var(--tws-accent-strong); }
.tws-form-notice--error { background: #fdecec; color: #b42318; }
@media (max-width: 600px) {
  .tws-form-row { flex-direction: column; gap: 0; }
}
.tws-entry-header { margin-bottom: 34px; }
.tws-entry-header .wp-block-post-terms { margin-bottom: 16px; }
.tws-entry-header .wp-block-post-terms a {
  display: inline-block;
  background: var(--tws-accent-soft);
  color: var(--tws-accent-strong);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  padding: 5px 11px;
  border-radius: 999px;
}
.tws-entry-header .wp-block-post-terms a:hover { background: var(--tws-accent); color: #fff; }
.tws-entry-header .wp-block-post-title,
.tws-page-title {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.tws-entry-meta { color: var(--tws-muted); gap: 14px; align-items: center; margin-top: 20px; }
.tws-entry-meta .wp-block-post-author { margin: 0; align-items: center; }
.tws-entry-meta .wp-block-post-author__avatar { display: flex; }
.tws-entry-meta .wp-block-post-author__avatar img { border-radius: 50%; display: block; }
.tws-entry-meta .wp-block-post-author__byline { display: none; }
.tws-entry-meta .wp-block-post-author__content { display: flex; align-items: center; }
.tws-entry-meta .wp-block-post-author__name { font-weight: 550; line-height: 1; color: var(--wp--preset--color--foreground); }
.tws-entry-meta .wp-block-post-date { line-height: 1; }
.tws-card-footer .wp-block-post-author { align-items: center; }

/* Author bio box (end of a single post) */
.tws-author-bio {
  margin-top: 46px;
  padding: 24px 26px;
  background: var(--tws-soft);
  border: 1px solid var(--tws-border);
  border-radius: 16px;
  align-items: flex-start;
  gap: 18px;
}
.tws-author-bio .wp-block-post-author__avatar { flex: 0 0 auto; }
.tws-author-bio .wp-block-post-author__avatar img { border-radius: 50%; width: 60px; height: 60px; }
.tws-author-bio .wp-block-post-author__byline {
  margin: 0;
  color: var(--tws-muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.tws-author-bio .wp-block-post-author__name {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  font-size: 1.18rem;
  margin: 3px 0 0;
}
.tws-author-bio .wp-block-post-author__bio {
  color: var(--tws-muted);
  margin-top: 7px;
  line-height: 1.6;
  font-size: 0.96rem;
}
.tws-single-image img { width: 100%; max-height: 680px; object-fit: cover; border-radius: 10px; }
.tws-prose { font-size: 1.08rem; line-height: 1.78; }
.tws-prose h2,
.tws-prose h3 { margin-top: 1.7em; }

.tws-about-layout { gap: clamp(34px, 7vw, 90px); align-items: center !important; }
.tws-about-placeholder {
  background: var(--tws-soft);
  min-height: 480px;
  border: 1px dashed var(--tws-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tws-muted);
}
.tws-page-intro { color: var(--tws-muted); font-size: 1.12rem; }

/* About page: demo image + stats band */
.tws-about-image { margin: 30px 0; }
.tws-about-image img { width: 100%; border-radius: 18px; display: block; }
.tws-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 20px;
  margin: 36px 0;
}
/* Grid children come from a WP group, which adds a block-gap top margin to
   every child except the first — zero it so all three cards match. */
.tws-stats > * { margin: 0; }
.tws-stat {
  background: var(--tws-soft);
  border: 1px solid var(--tws-border);
  border-radius: 16px;
  padding: 30px 22px;
  text-align: center;
}
.tws-stat-num {
  font-family: var(--wp--preset--font-family--heading);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 700;
  color: var(--tws-accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.tws-stat-label { color: var(--tws-muted); margin: 10px 0 0; font-size: 0.94rem; }
@media (max-width: 680px) {
  .tws-stats { grid-template-columns: 1fr; gap: 14px; }
}

/* Side gutters so wide content never touches the screen edges below the
   1240px wide-size (tablets, small laptops). Dark full-bleed bands keep their
   own inner padding and are excluded. */
@media (max-width: 1280px) {
  .tws-header-inner,
  .tws-site-footer,
  .featured-query,
  .post-grid,
  .tws-ad-row,
  .tws-view-all,
  .tws-content-shell > * {
    padding-left: clamp(18px, 3.5vw, 32px);
    padding-right: clamp(18px, 3.5vw, 32px);
  }
}

@media (max-width: 960px) {
  .post-grid .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tws-featured-card { min-height: 0; }
  .tws-featured-image img { min-height: 320px; }
}

/* Tablet: drop header social icons (they live in the footer) to save room */
@media (max-width: 900px) {
  .tws-header-actions .tws-social { display: none; }
  .tws-main-nav .wp-block-navigation__container { gap: 22px; }
}

/* Featured card stacks at WP core's own column-stacking breakpoint (781px),
   so its image rounds on top instead of keeping desktop left-side rounding. */
@media (max-width: 781px) {
  .tws-featured-card { display: block !important; }
  .tws-featured-image img { min-height: 220px; max-height: 320px; border-radius: 20px 20px 0 0; }
  .tws-featured-copy { padding: 28px 24px; }
}

@media (max-width: 680px) {
  /* Glue the newsletter banner to the header (no cream gap) */
  .tws-main { padding-top: 0; }

  /* Single column everywhere */
  .post-grid .wp-block-post-template { grid-template-columns: 1fr; }
  .tws-post-card { padding: 14px 14px 20px; }
  .tws-featured-copy .wp-block-post-title { font-size: clamp(1.7rem, 7vw, 2.2rem); }

  /* Headings scale down */
  .tws-entry-header .wp-block-post-title,
  .tws-page-title { font-size: clamp(2rem, 9vw, 3rem); }
  .tws-newsletter-hero .tws-page-title { font-size: clamp(2rem, 9vw, 2.8rem); }
  .tws-newsletter-banner h1,
  .tws-newsletter-banner h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .tws-prose { font-size: 1.02rem; }

  /* Footer spacing */
  .tws-footer-grid { gap: 30px; }
  .tws-footer-bottom { gap: 14px; }
}

/* Phones: clean one-row header (logo · Subscribe · hamburger) */
@media (max-width: 600px) {
  .tws-header-inner { flex-wrap: nowrap; gap: 10px; min-height: 58px; }
  .tws-brand { margin-right: auto; gap: 8px; min-width: 0; }
  .tws-brand .wp-block-site-logo img { max-height: 42px; }
  /* Mobile: show the logo emblem only, drop the wordmark */
  .tws-brand .wp-block-site-title { display: none; }
  .tws-header-actions { order: 2; width: auto; gap: 8px; flex: 0 0 auto; }
  .tws-main-nav { order: 3; flex: 0 0 auto; }
  .tws-main-nav .wp-block-navigation__responsive-container-open { padding: 6px; }
  .tws-header-cta .wp-block-button__link { padding: 7px 14px; font-size: 0.82rem; }

  /* Stack the inline signup */
  .tws-signup-row { flex-direction: column; }
  .tws-signup-btn { width: 100%; }

  /* Footer bottom: stack the credit and badge cleanly */
  .tws-footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .tws-footer-credit { flex-wrap: wrap; gap: 3px 6px; }
  .tws-footer-credit .wp-block-site-title,
  .tws-footer-credit .wp-block-site-title a { white-space: nowrap; }
}

