.lf-single-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 330px;
  gap:32px;
  align-items:start;
}

.lf-single-main{
  min-width:0;
}

.lf-single-article{
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  border:1px solid var(--lf-border);
  border-radius:30px;
  box-shadow:var(--lf-shadow-sm);
  padding:38px;
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

.lf-single-cat-wrap{
  margin-bottom:14px;
}

.lf-single-title{
  margin:0 0 12px;
  font-size:48px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.035em;
  color:var(--lf-text);
}

.lf-single-meta{
  margin-bottom:22px;
  color:var(--lf-muted);
  font-size:14px;
  font-weight:600;
}

.lf-single-thumb{
  margin-bottom:26px;
  border-radius:24px;
  overflow:hidden;
  background:#eef2ff;
  box-shadow:0 6px 16px rgba(15,23,42,.04);
}

.lf-single-thumb img{
  width:100%;
  height:auto;
  display:block;
}

/* ARTICLE CONTENT */
.lf-single-content{
  max-width:100%;
  min-width:0;
  font-size:18px;
  line-height:1.95;
  color:var(--lf-text);
  overflow-wrap:break-word;
  word-break:normal;
}

.lf-single-content h2,
.lf-single-content h3,
.lf-single-content h4{
  margin-top:34px;
  margin-bottom:14px;
  font-weight:900;
  line-height:1.18;
  color:var(--lf-text);
  scroll-margin-top:110px;
}

.lf-single-content h2{
  font-size:34px;
}

.lf-single-content h3{
  font-size:27px;
}

.lf-single-content h4{
  font-size:22px;
}

.lf-single-content p{
  margin:0 0 18px;
}

/* LISTS - number cut fix */
.lf-single-content ul,
.lf-single-content ol{
  margin-top:0;
  margin-right:0;
  margin-bottom:22px;
}

.lf-single-content ul{
  padding-left:1.35em;
}

.lf-single-content ol{
  list-style-position:outside;
  padding-left:2.75em;
  overflow:visible;
}

.lf-single-content li{
  margin:0 0 10px;
  padding-left:.12em;
  overflow:visible;
}

.lf-single-content ol li::marker{
  font-variant-numeric:tabular-nums;
}

.lf-single-content li > ol,
.lf-single-content li > ul{
  margin-top:10px;
  margin-bottom:10px;
}

.lf-single-content blockquote{
  margin:24px 0;
  padding:20px 22px;
  border-left:4px solid var(--lf-primary);
  background:linear-gradient(180deg,#f8fbff 0%,#f3f8ff 100%);
  border-radius:18px;
}

.lf-single-content a{
  color:var(--lf-secondary);
  font-weight:700;
}

.lf-single-content a:hover{
  color:var(--lf-primary-dark);
}

/* Article images */
.lf-single-content img{
  max-width:100%;
  height:auto;
  margin:22px 0;
  border-radius:20px;
  box-shadow:0 5px 14px rgba(15,23,42,.035);
}

@media (min-width:768px){
  .lf-single-thumb,
  .lf-single-thumb img,
  .lf-single-content img{
    transition:none;
    transform:none;
    will-change:auto;
  }
}

.lf-single-after-content{
  margin-top:32px;
}

/* =========================================================
   ARTICLE CONTENT TABLES ONLY
   This does NOT target Table of Contents plugin
   Safe for 2, 3, 4, 5+ column post tables
   ========================================================= */

/* Common wrappers used in WordPress/articles */
.lf-single-content .wp-block-table,
.lf-single-content .table-wrap,
.lf-single-content .responsive-table{
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  margin:28px 0;
  padding-bottom:8px;
}

/* Tables inside wrappers */
.lf-single-content .wp-block-table table,
.lf-single-content .table-wrap table,
.lf-single-content .responsive-table table{
  width:100%;
  min-width:100%;
  max-width:none;
  border-collapse:separate;
  border-spacing:0;
  table-layout:auto;
  font-size:17px;
  line-height:1.75;
  background:#fff;
}

/* Direct table inside post content */
.lf-single-content > table{
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  border-collapse:separate;
  border-spacing:0;
  table-layout:auto;
  font-size:17px;
  line-height:1.75;
  background:#fff;
  margin:28px 0;
  padding-bottom:8px;
}

/* Keep direct table internal layout stable */
.lf-single-content > table thead,
.lf-single-content > table tbody{
  display:table;
  width:100%;
  min-width:620px;
}

.lf-single-content > table tr{
  display:table-row;
}

.lf-single-content > table th,
.lf-single-content > table td{
  display:table-cell;
}

/* All article table cells */
.lf-single-content table th,
.lf-single-content table td{
  padding:12px 16px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid var(--lf-border);
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
  hyphens:none;
  box-sizing:border-box;
}

.lf-single-content table th{
  font-weight:900;
  color:var(--lf-text);
}

.lf-single-content table th:first-child,
.lf-single-content table td:first-child{
  min-width:135px;
}

/* Mobile tables */
@media (max-width:767px){
  .lf-single-content .wp-block-table,
  .lf-single-content .table-wrap,
  .lf-single-content .responsive-table{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    margin:22px 0;
    padding-bottom:10px;
  }

  .lf-single-content .wp-block-table table,
  .lf-single-content .table-wrap table,
  .lf-single-content .responsive-table table{
    width:max-content;
    min-width:560px;
    max-width:none;
    font-size:15.5px;
    line-height:1.65;
  }

  .lf-single-content > table{
    font-size:15.5px;
    line-height:1.65;
  }

  .lf-single-content > table thead,
  .lf-single-content > table tbody{
    min-width:560px;
  }

  .lf-single-content table th,
  .lf-single-content table td{
    padding:10px 12px;
    min-width:120px;
    max-width:280px;
    overflow-wrap:break-word;
    word-break:normal;
    hyphens:none;
  }

  .lf-single-content table th:first-child,
  .lf-single-content table td:first-child{
    min-width:120px;
    max-width:185px;
  }
}

@media (max-width:420px){
  .lf-single-content .wp-block-table table,
  .lf-single-content .table-wrap table,
  .lf-single-content .responsive-table table{
    min-width:520px;
    font-size:15px;
  }

  .lf-single-content > table thead,
  .lf-single-content > table tbody{
    min-width:520px;
  }

  .lf-single-content table th,
  .lf-single-content table td{
    padding:9px 10px;
    min-width:110px;
    max-width:240px;
  }

  .lf-single-content table th:first-child,
  .lf-single-content table td:first-child{
    min-width:110px;
    max-width:170px;
  }
}

/* SHARE SECTION */
.lf-share-post{
  margin-bottom:30px;
  padding:30px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  border:1px solid var(--lf-border);
  border-radius:30px;
  box-shadow:var(--lf-shadow-sm);
}

.lf-share-head{
  margin-bottom:18px;
}

.lf-share-head h2{
  margin:0 0 8px;
  font-size:30px;
  line-height:1.15;
  font-weight:900;
}

.lf-share-head p{
  margin:0;
  color:var(--lf-muted);
  line-height:1.8;
}

.lf-share-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.lf-share-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid var(--lf-border);
  background:#fff;
  color:var(--lf-text);
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
  box-shadow:var(--lf-shadow-sm);
}

.lf-share-btn:hover{
  transform:translateY(-2px);
}

.lf-share-facebook:hover{
  background:#1877f2;
  color:#fff;
  border-color:#1877f2;
}

.lf-share-twitter:hover{
  background:#111827;
  color:#fff;
  border-color:#111827;
}

.lf-share-pinterest:hover{
  background:#e60023;
  color:#fff;
  border-color:#e60023;
}

.lf-share-telegram:hover{
  background:#229ed9;
  color:#fff;
  border-color:#229ed9;
}

.lf-share-whatsapp:hover{
  background:#25d366;
  color:#fff;
  border-color:#25d366;
}

.lf-share-linkedin:hover{
  background:#0a66c2;
  color:#fff;
  border-color:#0a66c2;
}

.lf-share-copy:hover{
  background:linear-gradient(180deg,var(--lf-primary) 0%,var(--lf-primary-dark) 100%);
  color:#fff;
  border-color:var(--lf-primary-dark);
}

.lf-share-note{
  margin:16px 0 0;
  color:var(--lf-muted);
  font-size:14px;
  line-height:1.75;
}

/* RELATED POSTS */
.lf-related-posts{
  margin-bottom:30px;
  padding:30px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  border:1px solid var(--lf-border);
  border-radius:30px;
  box-shadow:var(--lf-shadow-sm);
}

.lf-related-posts h2{
  margin:0 0 20px;
  font-size:30px;
  line-height:1.15;
  font-weight:900;
}

.lf-post-grid-related{
  grid-template-columns:repeat(3,1fr);
}

/* =========================================================
   SIDEBAR
   Existing sticky behavior preserved
   ========================================================= */

.lf-sidebar {
  min-width: 0;
  /* align-self:start is THE key — sidebar shrinks to its content height
     so sticky has something to "stick" against */
  align-self: start;
}

.lf-sidebar-inner {
  /* sticky: starts at top of viewport (minus header),
     scrolls with page until sidebar runs out of room,
     then sticks. On scroll-up, moves back up naturally. */
  position: sticky;
  top: calc(var(--lf-header-height, 68px) + 20px);
  /* NO overflow, NO max-height — that causes internal scroll */
}

.lf-widget{
  background:linear-gradient(180deg,#ffffff 0%,#fcfdff 100%);
  border:1px solid var(--lf-border);
  border-radius:26px;
  box-shadow:0 8px 18px rgba(15,23,42,.04);
  padding:24px;
  margin-bottom:20px;
}

.widget-title{
  margin:0 0 16px;
  font-size:22px;
  line-height:1.2;
  font-weight:900;
  color:var(--lf-text);
  letter-spacing:-.02em;
}

.lf-widget ul{
  list-style:none;
  margin:0;
  padding:0;
}

.lf-widget li{
  margin:0 0 14px;
  padding-bottom:14px;
  border-bottom:1px solid var(--lf-border);
}

.lf-widget li:last-child{
  margin-bottom:0;
  padding-bottom:0;
  border-bottom:0;
}

.lf-widget a{
  color:var(--lf-text);
  font-weight:700;
  font-size:15px;
  line-height:1.75;
}

.lf-widget a:hover{
  color:var(--lf-primary-dark);
}

.lf-widget p{
  margin:0 0 12px;
  color:var(--lf-muted);
}

/* Sidebar search only */
.lf-widget .search-form{
  display:flex;
  gap:10px;
}

.lf-widget .search-field{
  width:100%;
  min-height:48px;
  border:1px solid var(--lf-border);
  border-radius:16px;
  padding:0 14px;
  font-size:15px;
  background:#fff;
}

.lf-widget .search-field:focus{
  outline:none;
  border-color:#bfdbfe;
  box-shadow:0 0 0 4px rgba(37,99,235,.08);
}

.lf-widget .search-submit{
  min-height:48px;
  border:0;
  border-radius:16px;
  background:linear-gradient(180deg,var(--lf-primary) 0%,var(--lf-primary-dark) 100%);
  color:#fff;
  font-weight:800;
  padding:0 16px;
  cursor:pointer;
}

/* COMMENTS */
.lf-comments-wrap{
  margin-top:0;
  border-radius:30px;
  overflow:hidden;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  border:1px solid var(--lf-border);
  box-shadow:var(--lf-shadow-sm);
}

.lf-comments-inner{
  padding:30px;
}

.lf-comments-title,
.lf-comment-form-title{
  margin:0 0 18px;
  font-size:30px;
  line-height:1.15;
  font-weight:900;
}

.lf-comment-list{
  list-style:none;
  margin:0 0 28px;
  padding:0;
}

.lf-comment-list > li{
  margin:0 0 18px;
  padding:20px;
  border:1px solid var(--lf-border);
  border-radius:22px;
  background:#fff;
}

.lf-comment-list .children{
  list-style:none;
  margin:16px 0 0 18px;
  padding:0;
}

.comment-author{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:8px;
}

.comment-author img{
  border-radius:999px;
}

.comment-author .fn{
  font-style:normal;
  font-weight:800;
  color:var(--lf-text);
}

.comment-author .says{
  display:none;
}

.comment-meta{
  margin-bottom:12px;
  font-size:13px;
  color:var(--lf-muted);
}

.comment-content p{
  margin:0 0 12px;
  font-size:15px;
  line-height:1.85;
}

.reply a{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:0 13px;
  border:1px solid var(--lf-border);
  border-radius:999px;
  background:#fff;
  color:var(--lf-text);
  font-size:13px;
  font-weight:800;
}

.reply a:hover{
  background:#f3e8ff;
  color:var(--lf-secondary);
}

.comment-respond form{
  display:grid;
  gap:14px;
}

.comment-respond label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:700;
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea{
  width:100%;
  border:1px solid var(--lf-border);
  border-radius:16px;
  padding:14px 16px;
  font-size:15px;
  font-family:inherit;
  background:#fff;
}

.comment-respond input[type="text"]:focus,
.comment-respond input[type="email"]:focus,
.comment-respond input[type="url"]:focus,
.comment-respond textarea:focus{
  outline:none;
  border-color:#bfdbfe;
  box-shadow:0 0 0 4px rgba(37,99,235,.08);
}

.comment-respond textarea{
  min-height:180px;
  resize:vertical;
}

.comment-respond .submit{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:50px;
  padding:0 20px;
  border:0;
  border-radius:999px;
  background:linear-gradient(180deg,var(--lf-primary) 0%,var(--lf-primary-dark) 100%);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}

.comment-notes,
.logged-in-as{
  font-size:14px;
  color:var(--lf-muted);
}

/* AUTHOR BOX */
.lf-author-box{
  margin-top:32px;
}

.lf-author-box-inner{
  display:flex;
  align-items:center;
  gap:22px;
  padding:28px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  border:1px solid var(--lf-border);
  border-radius:30px;
  box-shadow:var(--lf-shadow-sm);
}

.lf-author-avatar img{
  width:90px;
  height:90px;
  border-radius:50%;
  object-fit:cover;
  box-shadow:0 6px 16px rgba(0,0,0,0.08);
}

.lf-author-content{
  flex:1;
}

.lf-author-label{
  font-size:13px;
  color:var(--lf-muted);
  font-weight:600;
  display:block;
  margin-bottom:6px;
}

.lf-author-name{
  margin:0;
  font-size:22px;
  font-weight:900;
  color:var(--lf-text);
}

.lf-author-text{
  margin:10px 0 14px;
  font-size:15px;
  line-height:1.8;
  color:var(--lf-muted);
}

.lf-author-links{
  display:flex;
  gap:14px;
}

.lf-author-links a{
  font-size:14px;
  font-weight:700;
  color:var(--lf-secondary);
  text-decoration:none;
}

.lf-author-links a:hover{
  color:var(--lf-primary-dark);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width:1100px){
  .lf-single-layout{
    grid-template-columns:minmax(0,1fr) 300px;
    gap:24px;
  }

  .lf-post-grid-related{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width:1024px){
  .lf-single-layout{
    grid-template-columns:1fr;
  }

  /* sidebar below tablet: not sticky (layout is single column) */
}

@media (max-width:767px){
  .lf-single-layout{
    gap:24px;
  }

  .lf-single-article{
    padding:22px;
    border-radius:24px;
  }

  .lf-single-title{
    font-size:35px;
    line-height:1.08;
  }

  .lf-single-content{
    font-size:17px;
    line-height:1.85;
  }

  .lf-single-content h2,
  .lf-single-content h3,
  .lf-single-content h4{
    scroll-margin-top:88px;
  }

  .lf-single-content h2{
    font-size:28px;
  }

  .lf-single-content h3{
    font-size:23px;
  }

  .lf-single-content h4{
    font-size:20px;
  }

  .lf-single-content ol{
    padding-left:3em;
  }

  .lf-single-content ul{
    padding-left:1.45em;
  }

  .lf-post-grid-related{
    grid-template-columns:1fr;
  }

  .lf-related-posts,
  .lf-share-post{
    padding:22px;
    border-radius:24px;
  }

  .lf-widget{
    padding:20px;
    border-radius:22px;
    box-shadow:0 6px 14px rgba(15,23,42,.035);
  }

  .lf-widget .search-form{
    flex-direction:column;
  }

  .lf-comments-inner{
    padding:22px;
  }

  .lf-comments-title,
  .lf-comment-form-title,
  .lf-share-head h2,
  .lf-related-posts h2{
    font-size:25px;
  }

  .lf-share-btn{
    width:100%;
  }

  .lf-author-box-inner{
    flex-direction:column;
    text-align:center;
    padding:22px;
    border-radius:24px;
  }

  .lf-author-avatar img{
    width:80px;
    height:80px;
  }

  .lf-author-links{
    justify-content:center;
    flex-wrap:wrap;
  }
}

@media (max-width:420px){
  .lf-single-article{
    padding:20px;
  }

  .lf-single-title{
    font-size:31px;
  }

  .lf-single-content ol{
    padding-left:3.15em;
  }
}

/* Touch devices par hover transforms off */
@media (hover:none) and (pointer:coarse){
  .lf-share-btn,
  .lf-widget,
  .lf-author-links a{
    transition:none;
  }

  .lf-share-btn:hover,
  .lf-widget:hover,
  .lf-author-links a:hover{
    transform:none;
  }
}
/* =========================================================
   COPY BUTTON — Per-Pun Line (Numbered Lists)
   Numbering is preserved via ::marker — we only flex the li content
   ========================================================= */

/* Make each list item a flex row: [number] [text ....] [Copy btn] */
/* ── NUMBERED LIST ITEMS WITH COPY BUTTON ──
   We do NOT use display:flex on <li> because it breaks ::marker numbering.
   Instead we use position:relative + absolute button on the right,
   with enough padding-right to keep text from hiding under the button.
*/
.lf-single-content ol {
  list-style: decimal;
  list-style-position: outside;
  padding-left: 2.5em;
  counter-reset: none;
}

.lf-single-content ol > li {
  position: relative;
  display: list-item !important;   /* preserve ::marker numbers */
  list-style: decimal;
  margin: 0 0 0 !important;
  padding: 8px 90px 8px 4px;       /* right padding = space for Copy button */
  border-bottom: 1px solid rgba(226, 232, 240, 0.45);
  line-height: 1.7;
}

.lf-single-content ol > li:last-child {
  border-bottom: 0;
}

/* Text wrapper — just inline, no flex */
.lf-single-content ol > li .lf-pun-text {
  display: inline;
}

/* Copy button */
.lf-copy-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1.5px solid var(--lf-border);
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  height: 28px;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  font-family: inherit;
}

.lf-copy-btn:hover {
  border-color: var(--lf-primary);
  color: var(--lf-primary);
  background: var(--lf-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.lf-copy-btn.lf-copied {
  border-color: #86efac !important;
  color: #15803d !important;
  background: #f0fdf4 !important;
  box-shadow: none !important;
}

.lf-copy-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Mobile: slightly smaller gap */
@media (max-width: 480px) {
  .lf-single-content ol > li {
    padding-right: 76px;
  }

  .lf-copy-btn {
    padding: 3px 8px;
    font-size: 11px;
    height: 26px;
  }
}
