/*
Theme Name: Personal Masonry
Theme URI: https://example.com/personal-masonry
Author: Blota
Author URI: https://example.com
Description: A clean, original personal blog theme with a soft pink background, rounded white cards and a responsive three-column masonry post grid. Includes an author intro, trending topics, a single-post info sidebar, share links, coloured previous/next cards and related posts. All code and styling are original.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: personal-masonry
Tags: blog, personal, masonry, three-columns, grid-layout, custom-logo, featured-images, threaded-comments, translation-ready
*/

:root {
  --pm-text: #1d2126;
  --pm-muted: #6b7280;
  --pm-border: #ffe1e7;
  --pm-bg: #fdf0f2;
  --pm-card: #ffffff;
  --pm-pink: #f95d7a;
  --pm-pink-dark: #e8435f;
  --pm-purple: #7c5cf0;
  --pm-blue: #1e90e8;
  --pm-teal: #2bb3a3;
  --pm-dark: #1d2126;
  --pm-radius: 18px;
  --pm-max: 1180px;
  --pm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pm-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--pm-bg);
  color: var(--pm-text);
  font-family: var(--pm-font);
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pm-pink-dark); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea { font: inherit; }
input, textarea { min-width: 0; }

.pm-skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: #111; color: #fff; padding: 10px 14px; }
.pm-skip-link:focus { left: 12px; top: 12px; }
.pm-container { width: min(var(--pm-max), calc(100% - 40px)); margin: 0 auto; }

/* Pill header */
.pm-header { padding: 16px 0 0; position: sticky; top: 12px; z-index: 50; }
.pm-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid var(--pm-border); border-radius: 999px;
  padding: 10px 12px 10px 20px; box-shadow: 0 10px 30px rgba(233, 30, 80, 0.08);
}
.pm-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; flex-shrink: 0; }
.pm-brand .custom-logo { max-height: 40px; width: auto; }
.pm-site-title { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.pm-site-title a { text-decoration: none; }
.pm-tagline { display: none; }
.pm-header-search { display: flex; align-items: center; gap: 6px; flex: 1; max-width: 260px; }
.pm-header-search input[type="search"] { flex: 1; border: 0; outline: none; padding: 8px 4px; background: transparent; }
.pm-header-search button { border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; }
.pm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.pm-nav a { text-decoration: none; font-size: 0.92rem; font-weight: 600; white-space: nowrap; }
.pm-nav .current-menu-item > a, .pm-nav .current_page_item > a { color: var(--pm-pink-dark); }
.pm-subscribe { background: var(--pm-pink); color: #fff !important; text-decoration: none; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; flex-shrink: 0; }
.pm-subscribe:hover { background: var(--pm-pink-dark); color: #fff !important; }

/* Home author intro + trending topics */
.pm-intro { text-align: center; padding: 44px 0 8px; }
.pm-intro-avatar img { border-radius: 50%; margin: 0 auto 14px; width: 96px; height: 96px; object-fit: cover; }
.pm-intro h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; }
.pm-intro h1 span { color: var(--pm-pink-dark); }
.pm-intro p { color: #4b5563; max-width: 620px; margin: 0 auto; }
.pm-newsletter-inline { display: flex; gap: 8px; max-width: 480px; margin: 22px auto 0; background: #fff; padding: 6px; border-radius: 999px; border: 1px solid var(--pm-border); }
.pm-newsletter-inline input[type="email"] { flex: 1; border: 0; outline: none; padding: 8px 12px; background: transparent; }
.pm-newsletter-inline button { border: 0; border-radius: 999px; background: var(--pm-pink); color: #fff; font-weight: 700; padding: 10px 18px; cursor: pointer; white-space: nowrap; }
.pm-trending { background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 24px; margin: 36px 0 8px; }
.pm-trending h2 { text-align: center; margin: 0 0 20px; font-size: 1.25rem; }
.pm-topics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.pm-topic { text-align: center; }
.pm-topic a { text-decoration: none; display: block; }
.pm-topic-circle {
  width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: #fff;
  background: linear-gradient(135deg, var(--pm-pink), var(--pm-purple)); position: relative;
}
.pm-topic-count {
  position: absolute; top: -4px; right: -4px; background: var(--pm-pink); color: #fff;
  font-size: 0.7rem; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #fff;
}
.pm-topic-name { font-size: 0.9rem; font-weight: 600; }
.pm-archive-title { font-size: 2rem; margin: 40px 0 8px; }
.pm-archive-desc { color: var(--pm-muted); margin: 0 0 28px; }

/* Masonry grid: 3 columns desktop, 2 tablet, 1 phone */
.pm-grid { column-count: 3; column-gap: 24px; padding: 24px 0 48px; }
.pm-card {
  break-inside: avoid; margin: 0 0 24px; background: var(--pm-card);
  border: 1px solid var(--pm-border); border-radius: var(--pm-radius); overflow: hidden;
  box-shadow: 0 6px 20px rgba(233, 30, 80, 0.05); transition: transform .18s ease, box-shadow .18s ease;
}
.pm-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(233, 30, 80, 0.12); }
.pm-card-media { position: relative; background: #ffeef1; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.pm-card-media img { width: 100%; height: 100%; object-fit: cover; }
.pm-card-media span { color: var(--pm-muted); font-size: 0.9rem; padding: 20px; text-align: center; }
.pm-badge {
  position: absolute; top: 14px; left: 0; color: #fff; font-size: 0.8rem; font-weight: 700;
  padding: 7px 16px 7px 14px; border-radius: 0 999px 999px 0; text-decoration: none; z-index: 2;
}
.pm-badge-0 { background: var(--pm-purple); } .pm-badge-1 { background: var(--pm-teal); }
.pm-badge-2 { background: var(--pm-pink); } .pm-badge-3 { background: var(--pm-blue); }
.pm-card-body { padding: 22px 22px 26px; text-align: center; }
.pm-card-title { font-size: 1.3rem; line-height: 1.3; margin: 8px 0 10px; letter-spacing: -0.01em; }
.pm-card-title a { text-decoration: none; }
.pm-card-excerpt { color: #4b5563; margin: 0 0 16px; }
.pm-card-meta { color: var(--pm-muted); font-size: 0.85rem; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.pm-card-meta img { border-radius: 50%; width: 26px; height: 26px; object-fit: cover; }
.pm-read-more { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 0.92rem; text-decoration: none; color: var(--pm-pink-dark); }

/* Single post: info sidebar on desktop, stacked on mobile */
.pm-single-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; padding: 36px 0 48px; }
.pm-single-sidebar { order: 1; }
.pm-single-main { order: 2; min-width: 0; background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 36px 38px 40px; }
.pm-info-box { background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 20px; margin-bottom: 24px; }
.pm-info-box h2, .pm-toc h2 { font-size: 1rem; margin: 0 0 14px; }
.pm-info-box dl { margin: 0; }
.pm-info-box dt { color: var(--pm-muted); font-size: 0.85rem; }
.pm-info-box dd { margin: 0 0 12px; font-weight: 600; }
.pm-toc { background: transparent; padding: 4px 4px 0; }
.pm-toc ol { margin: 0; padding-left: 20px; }
.pm-toc li { margin-bottom: 8px; }
.pm-toc a { text-decoration: none; font-size: 0.92rem; }
.pm-single-main h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 10px; text-align: center; letter-spacing: -0.02em; }
.pm-single-meta { color: var(--pm-muted); text-align: center; margin-bottom: 26px; font-size: 0.92rem; }
.pm-featured { border-radius: 14px; overflow: hidden; margin-bottom: 28px; }
.pm-content h2, .pm-content h3 { line-height: 1.3; scroll-margin-top: 90px; }
.pm-content blockquote { border-left: 3px solid var(--pm-pink); margin: 24px 0; padding: 4px 0 4px 20px; color: #4b5563; font-size: 1.1rem; font-style: italic; }
.pm-content figure { margin: 24px 0; max-width: 100%; }
.pm-content table { display: block; overflow-x: auto; max-width: 100%; }
.pm-content iframe, .pm-content video, .pm-content embed { max-width: 100%; }
.pm-tags { margin-top: 30px; color: var(--pm-muted); text-align: center; }
.pm-tags a { text-decoration: none; color: var(--pm-pink-dark); font-weight: 600; }

/* Share + copy link */
.pm-share { border-top: 1px solid var(--pm-border); border-bottom: 1px solid var(--pm-border); margin-top: 32px; padding: 20px 0; text-align: center; }
.pm-share-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 10px 0 16px; }
.pm-share-links a { text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.pm-copy { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
.pm-copy input { flex: 1; padding: 10px 12px; border: 1px solid var(--pm-border); border-radius: 8px; background: #fdf0f2; color: #4b5563; font-size: 0.88rem; }
.pm-copy button { border: 0; border-radius: 8px; background: var(--pm-pink); color: #fff; font-weight: 700; padding: 10px 16px; cursor: pointer; white-space: nowrap; }

/* Previous / next coloured cards */
.pm-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.pm-post-nav a { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; border-radius: 14px; padding: 18px 20px; min-width: 0; }
.pm-post-nav a:hover { color: #fff; opacity: 0.92; }
.pm-post-nav .pm-prev { background: var(--pm-purple); }
.pm-post-nav .pm-next { background: #6b2d5e; text-align: right; justify-content: flex-end; }
.pm-post-nav small { display: block; font-size: 0.8rem; opacity: 0.85; }
.pm-post-nav strong { display: block; font-size: 0.95rem; line-height: 1.35; overflow-wrap: break-word; }
.pm-post-nav .pm-arrow { font-size: 1.4rem; flex-shrink: 0; }

/* Related posts */
.pm-related { background: #fff; border: 1px solid var(--pm-border); border-radius: var(--pm-radius); padding: 24px; margin-top: 28px; }
.pm-related-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.pm-related-head h2 { margin: 0; font-size: 1.3rem; }
.pm-related ol { list-style: none; margin: 0; padding: 0; }
.pm-related li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--pm-border); }
.pm-related li:last-child { border-bottom: 0; }
.pm-related-num { background: var(--pm-dark); color: #fff; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; flex-shrink: 0; }
.pm-related a { text-decoration: none; font-weight: 600; }
.pm-btn { display: inline-block; background: var(--pm-blue); color: #fff !important; text-decoration: none; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* Comments */
.pm-comments { margin-top: 36px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--pm-border); border-radius: 10px; background: #fff;
}
.comment-form textarea { min-height: 120px; }
.comment-form .submit { border: 0; border-radius: 8px; background: var(--pm-pink); color: #fff; font-weight: 700; padding: 11px 20px; cursor: pointer; }
.comment-list { list-style: none; padding: 0; }
.comment-body { border: 1px solid var(--pm-border); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: #fff; }

/* Pagination, search, 404 */
.pm-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 0 0 56px; flex-wrap: wrap; }
.pm-pagination a, .pm-pagination span { background: #fff; border: 1px solid var(--pm-border); border-radius: 8px; padding: 9px 16px; text-decoration: none; font-weight: 700; font-size: 0.92rem; }
.pm-pagination .current { background: var(--pm-pink); color: #fff; border-color: var(--pm-pink); }
.pm-pagination .next { background: var(--pm-pink); color: #fff; border-color: var(--pm-pink); }
.pm-search-form { display: flex; gap: 8px; max-width: 460px; margin: 20px auto 0; }
.pm-search-form input[type="search"] { flex: 1; padding: 11px 14px; border: 1px solid var(--pm-border); border-radius: 999px; background: #fff; }
.pm-search-form button { padding: 11px 18px; border: 0; border-radius: 999px; background: var(--pm-dark); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pm-empty { text-align: center; padding: 56px 0; color: var(--pm-muted); }

/* Newsletter CTA + footer */
.pm-cta { background: #fff; border-top: 1px solid var(--pm-border); padding: 48px 0; text-align: center; }
.pm-cta h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0 0 10px; }
.pm-cta p { color: #4b5563; max-width: 560px; margin: 0 auto 20px; }
.pm-cta .pm-btn-dark { background: var(--pm-dark); color: #fff !important; text-decoration: none; padding: 12px 24px; border-radius: 8px; font-weight: 800; display: inline-block; }
.pm-footer { background: var(--pm-bg); padding: 40px 0 28px; color: var(--pm-muted); font-size: 0.92rem; }
.pm-footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 32px; margin-bottom: 28px; }
.pm-footer-grid h3 { color: var(--pm-text); margin: 0 0 14px; font-size: 1.05rem; }
.pm-footer-grid ul { list-style: none; margin: 0; padding: 0; }
.pm-footer-grid li { padding: 7px 0; border-bottom: 1px solid var(--pm-border); }
.pm-footer-grid li:last-child { border-bottom: 0; }
.pm-footer-grid a { text-decoration: none; }
.pm-footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--pm-border); padding-top: 20px; }
.pm-back-top { background: var(--pm-pink); color: #fff !important; text-decoration: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; position: fixed; right: 18px; bottom: 18px; z-index: 40; box-shadow: 0 8px 20px rgba(233,30,80,.25); }

.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--pm-muted); font-size: 0.85rem; text-align: center; }
.aligncenter { margin-left: auto; margin-right: auto; }

/* Responsive breakpoints */
@media (max-width: 900px) {
  .pm-grid { column-count: 2; }
  .pm-topics { grid-template-columns: repeat(3, 1fr); }
  .pm-single-layout { grid-template-columns: 1fr; }
  .pm-single-sidebar { order: 2; }
  .pm-single-main { order: 1; padding: 28px 24px 32px; }
  .pm-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 580px) {
  .pm-container { width: calc(100% - 28px); }
  .pm-header { top: 8px; }
  .pm-header-inner { flex-wrap: wrap; border-radius: 24px; padding: 12px 14px; }
  .pm-header-search { display: none; }
  .pm-nav { width: 100%; }
  .pm-nav ul { justify-content: flex-start; gap: 14px; }
  .pm-subscribe { padding: 8px 12px; }
  .pm-grid { column-count: 1; }
  .pm-intro { padding-top: 32px; }
  .pm-single-main { padding: 24px 18px 28px; }
  .pm-post-nav { grid-template-columns: 1fr; }
  .pm-post-nav .pm-next { text-align: left; justify-content: flex-start; }
  .pm-footer-grid { grid-template-columns: 1fr; }
  .pm-newsletter-inline { flex-wrap: wrap; border-radius: 18px; }
  .pm-newsletter-inline button { width: 100%; }
  .pm-copy { flex-wrap: wrap; }
  .pm-copy button { width: 100%; }
}
