/*
Theme Name: Swarm Clone
Theme URI: https://swarm.ptsecurity.com/
Author: usrbingo
Author URI: https://swarm.ptsecurity.com/
Description: A high-fidelity clone of the PT SWARM frontend. Built on Bootstrap 4 + Roboto, featuring the signature dark-red post titles, shadowed content images, sticky footer and a clean two-column blog layout. Bootstrap and the Roboto webfont are bundled locally (no external CDN).
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: swarm-clone
Tags: blog, two-columns, custom-menu, featured-images, sticky-post, threaded-comments, translation-ready
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --primary: #006fc6;
  --primary-hover: #00447a;
  --btn-primary: #006fc6;
  --btn-primary-hover: #005aa0;
  --btn-primary-border-hover: #005293;
  --title: #a80000;
  --title-hover: #8f0000;
  --meta: #6c757d;
  --meta-link: #343a40;
  --font-family: "Roboto", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* ==========================================================================
   Base
   ========================================================================== */
html { height: 100%; }

body {
  font-family: var(--font-family);
  color: #212529;
  font-size: 1rem;
  line-height: 1.65;
}

/* Sticky footer (works with body.d-flex.flex-column.h-100 + main.flex-shrink-0 + footer.mt-auto) */
.h-100 { height: 100% !important; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

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

/* Heading scale (toned down from Bootstrap defaults for a tighter, editorial feel) */
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: .9rem; }

/* ==========================================================================
   Header / navbar
   ========================================================================== */
.navbar-brand.font-weight-bold { font-weight: 700 !important; }
.navbar-light .navbar-brand { color: rgba(0, 0, 0, .9); }
.navbar-light .navbar-brand:hover { color: rgba(0, 0, 0, .9); text-decoration: none; }
.navbar-light .navbar-nav .nav-link { color: rgba(0, 0, 0, .5); }
.navbar-light .navbar-nav .nav-link:hover { color: rgba(0, 0, 0, .7); }
.navbar-light .navbar-nav .active > .nav-link,
.navbar-light .navbar-nav .current-menu-item > .nav-link { color: rgba(0, 0, 0, .9); }

/* Header "Follow @ptswarm" button.
   Scoped with .navbar for specificity so the blue background always wins over
   Bootstrap's anchor reboot / any plugin link styles. */
.navbar a.btn-twitter,
.btn-twitter {
  display: inline-flex !important;
  align-items: center;
  background-color: #1b95e0 !important;
  color: #fff !important;
  cursor: pointer;
  height: 28px;
  border-radius: 4px;
  padding: 1px 10px 1px 9px;
  font-size: 13px;
  line-height: 26px;
  white-space: nowrap;
  text-decoration: none !important;
}
.navbar a.btn-twitter:hover,
.btn-twitter:hover { background-color: #0c7abf !important; color: #fff !important; text-decoration: none !important; }
.navbar a.btn-twitter:focus,
.btn-twitter:focus { color: #fff; text-decoration: none; }
.btn-twitter i {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: transparent 0 0 no-repeat;
  background-size: 16px 16px;
  background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2072%2072%22%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M0%200h72v72H0z%22%2F%3E%3Cpath%20class%3D%22icon%22%20fill%3D%22%23fff%22%20d%3D%22M68.812%2015.14c-2.348%201.04-4.87%201.744-7.52%202.06%202.704-1.62%204.78-4.186%205.757-7.243-2.53%201.5-5.33%202.592-8.314%203.176C56.35%2010.59%2052.948%209%2049.182%209c-7.23%200-13.092%205.86-13.092%2013.093%200%201.026.118%202.02.338%202.98C25.543%2024.527%2015.9%2019.318%209.44%2011.396c-1.125%201.936-1.77%204.184-1.77%206.58%200%204.543%202.312%208.552%205.824%2010.9-2.146-.07-4.165-.658-5.93-1.64-.002.056-.002.11-.002.163%200%206.345%204.513%2011.638%2010.504%2012.84-1.1.298-2.256.457-3.45.457-.845%200-1.666-.078-2.464-.23%201.667%205.2%206.5%208.985%2012.23%209.09-4.482%203.51-10.13%205.605-16.26%205.605-1.055%200-2.096-.06-3.122-.184%205.794%203.717%2012.676%205.882%2020.067%205.882%2024.083%200%2037.25-19.95%2037.25-37.25%200-.565-.013-1.133-.038-1.693%202.558-1.847%204.778-4.15%206.532-6.774z%22%2F%3E%3C%2Fsvg%3E');
}
.btn-twitter .label {
  display: inline-block;
  white-space: nowrap;
  margin-left: 6px;
  line-height: 1;
}

/* ==========================================================================
   Articles
   ========================================================================== */
/* List (blog/archive/search) post titles — compact */
article .entry-title { font-weight: 700; font-size: 1.35rem; margin: .5rem 0 .75rem 0; line-height: 1.3; }
article .entry-title a { color: var(--title); }
article .entry-title a:hover { color: var(--title-hover); }

/* Single-post / page title — larger but still restrained */
.single article .entry-title,
.page article .entry-title { font-size: 1.9rem; line-height: 1.25; color: var(--title); }

article .entry-meta { color: var(--meta); margin: .5rem 0 1rem; font-size: .9rem; }
article .entry-meta a { color: var(--meta-link); }
article .entry-meta a:hover { color: var(--title); }

/* In the list view the thumbnail sits above the summary; keep them close. */
article .post-thumbnail { margin-bottom: 1.25rem; display: block; }
article .post-thumbnail img { max-width: 100%; height: auto; }
.single article .post-thumbnail,
.single article > .entry-content > .wp-post-image { margin-bottom: 2rem; }

article .entry-content { overflow-wrap: break-word; word-wrap: break-word; }
article .entry-content p { margin-bottom: 1rem; }
article .entry-summary p:last-child,
article .entry-content > p:last-child { margin-bottom: .5rem; }

article .wp-block-image { margin: .5rem 0 1.5rem 0; }
article .wp-block-image img {
  background: #fff;
  box-shadow: 0 0 15px 3px rgba(0, 0, 0, .2);
  max-width: 100%;
  height: auto;
}

article p code { font-size: 1rem; }

.entry-content pre,
.entry-content code {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Noto Sans Mono CJK SC", "Noto Sans SC", monospace;
}
.entry-content pre {
  background: #f6f8fa;
  padding: 1rem;
  border-radius: 4px;
  overflow: auto;
}
.entry-content blockquote {
  border-left: 4px solid #e9ecef;
  padding-left: 1rem;
  color: var(--meta);
  margin: 1rem 0;
}
.entry-content blockquote .blockquote-footer::before { content: "\2014 "; }

.more-link {
  display: inline-block;
  font-weight: 500;
  color: var(--primary);
}
.more-link:hover { color: var(--primary-hover); }
.more-link::after { content: " \2192"; }

/* ==========================================================================
   Buttons (Bootstrap primary override to PT blue)
   ========================================================================== */
.btn-primary {
  color: #fff;
  background-color: var(--btn-primary);
  border-color: var(--btn-primary);
}
.btn-primary:hover {
  color: #fff;
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-border-hover);
}
.btn-primary:focus {
  box-shadow: 0 0 0 .2rem rgba(38, 133, 207, .5);
}

/* ==========================================================================
   Sidebar widgets

   Covers BOTH classic widgets (h4.widget-title via the registered before_title)
   and block-based widgets (WP 5.8+: .wp-block-heading, bare h1–h4, latest-posts /
   latest-comments blocks). Sizes are forced so block inline/preset styles can't
   blow the titles up again.
   ========================================================================== */
.widget-area .widget { word-wrap: break-word; margin-bottom: 1.75rem; }

/* All sidebar overrides below are scoped to the sidebar's #secondary ID.
   ID specificity (1,x,y) outranks WordPress's class-level `!important` font-size
   presets (.has-X-font-size, block/global styles), which is why .widget-area
   alone wasn't enough to shrink the Recent Posts titles and the search box. */

/* Widget / block titles — small uppercase labels */
#secondary .widget-title,
#secondary .wp-block-heading,
#secondary h1,
#secondary h2,
#secondary h3,
#secondary h4,
#secondary h5,
#secondary .wp-block-search__label {
  font-weight: 700 !important;
  font-size: .9rem !important;
  line-height: 1.3 !important;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #495057 !important;
  margin-top: 0;
  margin-bottom: .85rem;
}

/* Lists — kill the block's default margins and set a tight, even rhythm so the
   shrunken text doesn't leave big vertical gaps between entries. */
#secondary ul,
#secondary ol,
#secondary .wp-block-latest-posts__list,
#secondary .wp-block-latest-posts,
#secondary .wp-block-latest-comments,
#secondary .wp-block-categories,
#secondary .wp-block-archives,
#secondary .wp-block-page-list {
  list-style: none;
  padding-left: 0;
  margin: 0 !important;
}
#secondary li {
  margin: 0 0 .4rem !important;
  padding: 0 !important;
  line-height: 1.4;
}
#secondary li:last-child { margin-bottom: 0 !important; }
/* Multi-line post titles wrap tightly without ballooning the row height. */
#secondary li a,
#secondary .wp-block-latest-posts__post-title { display: inline-block; }

/* Every text/link in the sidebar (Recent Posts titles, Comments, Categories,
   Archives, Pages, RSS …) forced to a compact size. */
#secondary li,
#secondary li a,
#secondary p,
#secondary a,
#secondary .wp-block-latest-posts__post-title,
#secondary .wp-block-latest-posts li > a,
#secondary .wp-block-latest-comments__comment,
#secondary .wp-block-latest-comments__comment-link,
#secondary .wp-block-latest-comments__comment-author,
#secondary .wp-block-latest-comments__comment-excerpt,
#secondary .wp-block-categories li,
#secondary .wp-block-archives li,
#secondary .wp-block-page-list a {
  font-size: .875rem !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
}

/* Title-link colours (override the generic blue link colour above). */
#secondary li a,
#secondary .wp-block-latest-posts__post-title { color: var(--meta-link) !important; }
#secondary li a:hover,
#secondary .wp-block-latest-posts__post-title:hover { color: var(--title) !important; }

/* Recent Posts date / RSS date meta */
#secondary .wp-block-latest-posts__post-date,
#secondary .post-date,
#secondary .rss-date { font-size: .78rem !important; color: var(--meta) !important; }

/* Search widget / block — shrink the field and button. */
#secondary .wp-block-search__input,
#secondary .search-field {
  font-size: .85rem !important;
  padding: .35rem .55rem !important;
  height: auto !important;
  line-height: 1.4 !important;
}
#secondary .wp-block-search__button,
#secondary .search-submit {
  font-size: .85rem !important;
  padding: .35rem .7rem !important;
  height: auto !important;
}
/* Keep the search button on the PT blue palette. */
#secondary .wp-block-search__button:not(.has-background),
#secondary .search-submit {
  background-color: var(--btn-primary) !important;
  border-color: var(--btn-primary) !important;
  color: #fff !important;
}

/* ==========================================================================
   Navigation (pagination)
   ========================================================================== */
.navigation.posts-navigation,
.navigation.post-navigation { margin: 2rem 0; }
.navigation .nav-links a { font-weight: 500; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { font-size: .9rem; border-top: 1px solid #f0f0f0; }
.footer a.icon {
  color: var(--meta-link);
  display: inline-block;
}
.footer a.icon:hover { color: var(--title); text-decoration: none; }
.icon:before {
  display: inline-block;
  content: " ";
  margin: 0 8px 0 0;
  background-repeat: no-repeat;
  background-position: left 2px;
  width: 18px;
  height: 18px;
  vertical-align: text-top;
}
.icon-twitter:before {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTggMTUiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTE3Ljk2NDggMS43NDIxOEMxNy4zMDEgMi4wMzM5MiAxNi41OTIzIDIuMjMyNjYgMTUuODQ2MSAyLjMyMzRDMTYuNjA2NiAxLjg2NTE3IDE3LjE5MTUgMS4xNDI5NSAxNy40NjgzIDAuMjgxMjM4QzE2Ljc1NTEgMC42OTc0NzEgMTUuOTY0NiAxLjAwMDQ2IDE1LjEyMzEgMS4xNjkyQzE0LjQ1MTEgMC40NDk5ODEgMTMuNDkzNCAwIDEyLjQzIDBDMTAuMzkyMyAwIDguNzQwMTQgMS42NTIxOCA4Ljc0MDE0IDMuNjg3NkM4Ljc0MDE0IDMuOTgwMDggOC43NzM4OCA0LjI2MTMyIDguODM1MzggNC41MzA1NkM1Ljc2ODAxIDQuMzg1ODIgMy4wNDkzNyAyLjkxMjg4IDEuMjI5OTUgMC42ODYyMjFDMC45MDk3MTIgMS4yMjc3IDAuNzMwNDcgMS44NTY5MiAwLjczMDQ3IDIuNTQyMzlDMC43MzA0NyAzLjgyNDg0IDEuMzgyOTQgNC45NTIwNCAyLjM3MTQgNS42MTQyN0MxLjc2NjE4IDUuNTk0NzcgMS4xOTY5NSA1LjQyODI3IDAuNzAwNDcxIDUuMTUyMjlWNS4xOTgwM0MwLjcwMDQ3MSA2Ljk4NjcxIDEuOTcwMTcgOC40Nzg0IDMuNjU5ODUgOC44MTgxM0MzLjM1MDExIDguOTAxMzggMy4wMjMxMiA4Ljk0NjM4IDIuNjg3ODkgOC45NDYzOEMyLjQ1MjQgOC45NDYzOCAyLjIyNjY2IDguOTIzODggMi4wMDA5MiA4Ljg4MTg4QzIuNDc0MTUgMTAuMzQ2NiAzLjgzNDU5IDExLjQxNDUgNS40NTM3NyAxMS40NDQ1QzQuMTkzODMgMTIuNDMzNyAyLjU5NzE0IDEzLjAyMzIgMC44Nzc0NjMgMTMuMDIzMkMwLjU4NDk3NiAxMy4wMjMyIDAuMjkzMjM4IDEzLjAwNiAwIDEyLjk3M0MxLjY0MTY4IDE0LjAxODQgMy41NzU4NSAxNC42Mjk2IDUuNjY3NTEgMTQuNjI5NkMxMi40NTc3IDE0LjYyOTYgMTYuMTY2MyA5LjAwNzg3IDE2LjE2NjMgNC4xNDA1OEMxNi4xNjYzIDMuOTgzODMgMTYuMTY2MyAzLjgyNTU5IDE2LjE1NTEgMy42NjgxQzE2Ljg3NTggMy4xNTEzNyAxNy41MDUgMi40OTgxNSAxOCAxLjc1NzE4TDE3Ljk2NDggMS43NDIxOFoiCiAgICAgICAgZmlsbD0iIzAwYWNlZSIvPgo8L3N2Zz4=');
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comment-list { list-style: none; padding-left: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { margin-bottom: 1.5rem; }
.comment-author .fn { font-weight: 700; }
.comment-meta { font-size: .85rem; color: var(--meta); }

/* ==========================================================================
   Accessibility
   ========================================================================== */
.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;
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  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;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 575.98px) {
  /* The navbar stays single-row (navbar-expand); keep it from overflowing. */
  .navbar-brand { font-size: 1.05rem; margin-right: .5rem; }
  .navbar-nav .nav-link { padding-right: .4rem; padding-left: .4rem; }
  .btn-twitter .label { display: none; }      /* show just the icon on phones */
  .btn-twitter { padding: 1px 8px; }

  .single article .entry-title,
  .page article .entry-title { font-size: 1.5rem; }
  article .entry-title { font-size: 1.2rem; }
}


/* ==========================================================================
   Recent Posts-only right rail alignment
   ========================================================================== */
#secondary.recent-posts-only .widget {
  margin-top: 1.5rem !important;
  margin-bottom: 1.75rem !important;
}
#secondary.recent-posts-only .wp-block-heading {
  margin-bottom: .85rem !important;
}
.blog #secondary.recent-posts-only .widget,
.home #secondary.recent-posts-only .widget,
.single #secondary.recent-posts-only .widget {
  margin-top: 1.5rem !important;
}
@media (min-width: 768px) {
  .home #secondary.recent-posts-only,
  .blog #secondary.recent-posts-only,
  .single #secondary.recent-posts-only {
    padding-top: 0;
  }
}


/* ==========================================================================
   Comments form — Bootstrap-style layout
   ========================================================================== */
.comments-area {
  border-top: 1px solid #e9ecef;
  padding-top: 2rem;
}

.comment-respond {
  margin-top: 2rem;
}

.comment-reply-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--title);
  margin-bottom: 1rem;
}

.comment-notes {
  color: var(--meta);
  font-size: .85rem;
  margin-bottom: 1rem;
}

.comment-form p {
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  margin-bottom: .35rem;
  font-weight: 500;
  font-size: .9rem;
  color: #495057;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  display: block;
  width: 100%;
  padding: .375rem .75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  box-shadow: none;
}

.comment-form textarea:focus,
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus {
  border-color: var(--btn-primary);
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(0, 111, 198, .25);
}

.comment-form textarea {
  min-height: 9rem;
  resize: vertical;
}

.comment-form .required {
  color: #dc3545;
}

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.comment-form-cookies-consent input[type="checkbox"] {
  margin-top: .25rem;
}

.comment-form-cookies-consent label {
  display: inline;
  font-weight: 400;
  font-size: .85rem;
  color: var(--meta);
  margin-bottom: 0;
}

.comment-form input[type="submit"].btn-primary {
  width: auto;
}
