/*
Theme Name:  Lotfi Piano Blog
Theme URI:   https://lotfipiano.ae
Description: Child theme for GeneratePress — mirrors the Lotfi Piano main website design system exactly (Playfair Display, gold brand palette, sticky frosted header, animated nav, mobile drawer, matching footer).
Author:      Lotfi Piano
Template:    generatepress
Version:     1.0.0
License:     GNU General Public License v2 or later
Text Domain: lotfi-child
*/

/* ============================================================
   CUSTOM FONTS
   ============================================================ */

/*
 * "Melodica Numbers" — DM Sans applied only to digit characters (U+30-39).
 * Identical to the @font-face in the Next.js globals.css.
 * This ensures numbers render in a clean sans-serif while all other
 * text uses Playfair Display.
 */
@font-face {
  font-family: "Melodica Numbers";
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/dm-sans@latest/latin-400-normal.woff2") format("woff2");
  unicode-range: U+30-39; /* digits 0–9 only */
  font-weight: 100 900;
  font-display: swap;
}

/* ============================================================
   CSS VARIABLES — Brand Design System (ported from globals.css)
   ============================================================ */
:root {
  --background:             #ffffff;
  --foreground:             #171717;
  --maincolor:              #ba9130;
  --text-color:             #333;
  --background-color:       #d2ac2a;
  --background-transparent: rgba(210, 172, 42, 0.1);
  --ctacolor:               #580000;
  --bordercolor:            #f2f2f2;
  --cardcolor:              #f9f9f9;
  --sectionBackground:      rgba(210, 172, 42, 0.1);
  --success:                #3fae4b;
  --font-sans:              'Playfair Display', ui-serif, Georgia, serif;
  /* Numbers font applied first so digits get DM Sans — matches layout.tsx body style */
  --font-body:              "Melodica Numbers", 'Playfair Display', ui-serif, Georgia, serif;
}

/* ============================================================
   BASE TYPOGRAPHY
   ============================================================ */
body {
  /* Melodica Numbers handles digits; Playfair Display handles everything else.
     Mirrors the exact fontFamily set on <body> in layout.tsx. */
  font-family: var(--font-body) !important;
  color: var(--foreground);
  background: var(--background);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body) !important;
  font-weight: 600;
  color: var(--foreground);
}

h1 { font-weight: 700; }

a {
  color: var(--maincolor);
  transition: color 0.2s ease;
}

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

/* ============================================================
   SUPPRESS GENERATEPRESS DEFAULT HEADER / FOOTER / BACK-TO-TOP
   ============================================================ */
.site-header,
.main-navigation,
.nav-primary,
.generate-back-to-top,
.site-footer,
.footer-bar {
  display: none !important;
}

/* ============================================================
   KILL ALL GENERATEPRESS LAYOUT CONSTRAINTS
   Our templates produce their own HTML — we don't want GP's
   grid/column/padding system to interfere at all.
   ============================================================ */

/* ── Full-width page + content wrappers — force BLOCK layout ── */
/* .grid-parent is GP's flexbox class — must be display:block to stop
   siblings rendering side-by-side */
#page,
.site,
#content,
.site-content,
.grid-container,
.grid-container.container,
.grid-parent,
.generate-columns-container {
  display: block !important;   /* kill GP's flex/grid row layout */
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  box-sizing: border-box !important;
}

/* ── Kill GP article/column wrapping completely ── */
.content-area,
.inside-article,
.entry-header,
.entry-content,
.entry-footer,
.entry-summary,
.inside-right-sidebar,
.inside-left-sidebar,
.widget-area,
.sidebar-container,
.generate-sidebar-layout-container {
  display: block !important;
  max-width: none !important;
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* ── Our hero + wrapper must stack vertically ── */
.lotfi-single-cover,
.lotfi-single-wrapper {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  clear: both !important;
  box-sizing: border-box !important;
}

/* ── RESTORE our own single-post containers after the GP reset above ── */
.lotfi-single-wrapper,
.lotfi-single,
.entry-content-custom,
.entry-tags,
.lotfi-author-box,
.lotfi-post-nav,
.lotfi-related-posts,
.lotfi-featured-post,
.lotfi-blog-container,
.lotfi-posts-grid,
.lotfi-archive-banner {
  /* These classes are safe — no GP override targets them.
     The !important on each rule set is the real guard. */
  box-sizing: border-box;
}

/* GP sometimes inserts extra padding via these classes */
.site-content > .inside-site-container,
.site-content > .inside-container {
  padding: 0 !important;
  max-width: none !important;
}

/* Remove GP's own post title / meta styling that fights ours */
.entry-title { margin: 0 !important; padding: 0 !important; font-size: inherit !important; }
.entry-meta  { font-size: inherit !important; color: inherit !important; }

/* ============================================================
   HEADER — frosted-glass sticky bar, 60 px tall
   ============================================================ */
.lotfi-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(210, 172, 42, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lotfi-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: rgba(210, 172, 42, 0.15);
}

.lotfi-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  padding: 0 1rem;
}

@media (min-width: 640px)  { .lotfi-header-inner { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .lotfi-header-inner { padding: 0 2rem;   } }
@media (min-width: 1280px) { .lotfi-header-inner { padding: 0 2.5rem; } }

/* ── Logo ── */
.lotfi-header-left { display: flex; align-items: center; }

.lotfi-logo,
.lotfi-logo .custom-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.lotfi-logo img,
.lotfi-logo .custom-logo {
  height: 32px !important;
  width: auto !important;
  max-height: 32px !important;
  max-width: 120px !important;
  object-fit: contain;
  display: block;
}

@media (min-width: 640px) {
  .lotfi-logo img,
  .lotfi-logo .custom-logo { height: 36px !important; max-height: 36px !important; max-width: 140px !important; }
}
@media (min-width: 1024px) {
  .lotfi-logo img,
  .lotfi-logo .custom-logo { height: 40px !important; max-height: 40px !important; max-width: 150px !important; }
}

.lotfi-logo-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--foreground);
  text-decoration: none;
}

/* ============================================================
   DESKTOP NAVIGATION (visible ≥ 1200 px)
   ============================================================ */
.lotfi-primary-nav {
  display: none;
  margin-left: 1rem;
}

@media (min-width: 1200px) { .lotfi-primary-nav { display: block; } }

.lotfi-primary-nav ul,
.lotfi-primary-nav .lotfi-desktop-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.lotfi-primary-nav ul li { position: relative; margin: 0; padding: 0; }

/* Nav link — gold animated underline */
.lotfi-primary-nav ul li > a,
.nav-link-modern {
  position: relative;
  color: #4b5563;
  text-decoration: none;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.1rem 0.45rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  font-family: var(--font-sans);
}

.lotfi-primary-nav ul li > a::after,
.nav-link-modern::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d2ac2a, transparent);
  transform: translateX(-50%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.lotfi-primary-nav ul li > a:hover,
.lotfi-primary-nav ul li.current-menu-item > a,
.lotfi-primary-nav ul li.current-menu-ancestor > a {
  color: #d2ac2a;
}

.lotfi-primary-nav ul li > a:hover::after,
.lotfi-primary-nav ul li.current-menu-item > a::after,
.lotfi-primary-nav ul li.current-menu-ancestor > a::after { width: 100%; }

.lotfi-primary-nav ul li.current-menu-item > a,
.lotfi-primary-nav ul li.current-menu-ancestor > a { font-weight: 600; }

/* Chevron */
.lotfi-chevron {
  display: inline-block;
  margin-left: 3px;
  vertical-align: middle;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lotfi-primary-nav .menu-item-has-children:hover > a .lotfi-chevron {
  transform: rotate(180deg);
}

/* Bridge gap so sub-menu stays open on mouse travel */
.lotfi-primary-nav .menu-item-has-children::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.75rem;
  background: transparent;
}

/* Dropdown panel */
.lotfi-primary-nav ul .sub-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  min-width: 14rem;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid #f1f1f1;
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s;
  z-index: 9990;
  pointer-events: none;
}

.lotfi-primary-nav .menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.lotfi-primary-nav .sub-menu li > a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  font-weight: 400;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lotfi-primary-nav .sub-menu li > a::after { display: none; }

.lotfi-primary-nav .sub-menu li > a:hover {
  background: rgba(210, 172, 42, 0.05);
  color: #d2ac2a;
  padding-left: 1.25rem;
}

/* B2B badge */
.lotfi-b2b-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  background: rgba(186, 145, 48, 0.12);
  color: #ba9130;
  border: 1px solid rgba(186, 145, 48, 0.25);
  margin-right: 0.25rem;
  line-height: 1;
  vertical-align: middle;
}

/* ============================================================
   HEADER ICON BUTTONS
   ============================================================ */
.lotfi-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 1rem;
}

.lotfi-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.5rem;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.lotfi-icon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(210, 172, 42, 0.1);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lotfi-icon-btn:hover::before { opacity: 1; transform: scale(1); }
.lotfi-icon-btn:hover { color: #d2ac2a; }
.lotfi-icon-btn svg { width: 24px; height: 24px; display: block; }

/* Hamburger (hidden ≥ 1200 px) */
.lotfi-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #4b5563;
  border-radius: 0.375rem;
  margin-left: 0.75rem;
  transition: color 0.2s;
}

.lotfi-hamburger:hover { color: #d2ac2a; }

@media (min-width: 1200px) { .lotfi-hamburger { display: none; } }

/* ============================================================
   MOBILE MENU DRAWER
   ============================================================ */
.lotfi-mobile-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9996;
}

.lotfi-mobile-backdrop.open { opacity: 1; pointer-events: auto; }

.lotfi-mobile-menu {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 20rem;
  max-width: 85vw;
  background: #fff;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 9997;
  border-radius: 0 0.5rem 0.5rem 0;
  transform: translate3d(-100%, 0, 0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.lotfi-mobile-menu.open { transform: translate3d(0, 0, 0); pointer-events: auto; }

.lotfi-mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--bordercolor);
}

.lotfi-mobile-menu-header h2 { font-size: 1.125rem; font-weight: 600; margin: 0; }

.lotfi-mobile-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #4b5563;
  border-radius: 0.375rem;
  transition: color 0.2s;
}

.lotfi-mobile-close:hover { color: #d2ac2a; }

.lotfi-mobile-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.lotfi-mobile-nav ul,
.lotfi-mobile-nav .lotfi-mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.lotfi-mobile-nav ul li a,
.mobile-link-modern {
  display: block;
  padding: 0.625rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
}

.lotfi-mobile-nav ul li a:hover,
.mobile-link-modern:hover { background: rgba(210, 172, 42, 0.05); color: #d2ac2a; }

.lotfi-mobile-nav ul li.current-menu-item > a,
.mobile-link-modern.active { background: rgba(210, 172, 42, 0.1); color: #d2ac2a; font-weight: 600; }

.lotfi-mobile-submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.625rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
}

.lotfi-mobile-submenu-toggle:hover { background: rgba(210, 172, 42, 0.05); color: #d2ac2a; }

.lotfi-chevron-sm { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; }
.lotfi-mobile-submenu-toggle.open .lotfi-chevron-sm { transform: rotate(180deg); }

.lotfi-mobile-nav .sub-menu {
  list-style: none;
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 0;
  display: none;
}

.lotfi-mobile-nav .sub-menu.open { display: block; }

.lotfi-mobile-nav .sub-menu li a {
  font-size: 0.875rem;
  color: #6b7280;
  padding: 0.5rem 1rem;
}

/* ============================================================
   SEARCH OVERLAY (modal)
   ============================================================ */
.lotfi-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lotfi-search-overlay.open { opacity: 1; pointer-events: auto; }

.lotfi-search-box {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 560px;
  margin: 0 1rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lotfi-search-overlay.open .lotfi-search-box { transform: translateY(0); }

.lotfi-search-form { display: flex; gap: 0.625rem; }

.lotfi-search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--bordercolor);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: #fff;
  outline: none;
  font-family: var(--font-sans);
  color: var(--foreground);
  transition: border-color 0.2s;
}

.lotfi-search-input:focus {
  border-color: var(--maincolor);
  box-shadow: 0 0 0 3px rgba(186, 145, 48, 0.1);
}

.lotfi-search-btn {
  padding: 0.75rem 1.25rem;
  background: var(--maincolor);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.2s;
  font-family: var(--font-sans);
}

.lotfi-search-btn:hover { background: var(--background-color); }

.lotfi-search-close {
  display: block;
  width: 100%;
  text-align: right;
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-top: 0.75rem;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
  font-family: var(--font-sans);
}

.lotfi-search-close:hover { color: var(--foreground); }

/* ============================================================
   CONTENT LAYOUT — reset GP defaults
   ============================================================ */
.grid-container.container { max-width: 100% !important; padding: 0 !important; }
.site-content { padding-top: 0 !important; }
#content      { padding-top: 0; }
.content-area { padding: 0 !important; }
.generate-columns-container, .inside-article { padding: 0 !important; }

/* Blog wrapper */
.lotfi-blog-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

@media (min-width: 640px)  { .lotfi-blog-container { padding: 3rem 1.5rem;   } }
@media (min-width: 1024px) { .lotfi-blog-container { padding: 3.5rem 2rem;   } }


/* ============================================================
   ARCHIVE / CATEGORY BANNER
   ============================================================ */
.lotfi-archive-banner {
  background: radial-gradient(131.33% 138.78% at 115.47% -47.87%, #ffe7b0 0%, #faf7ee 100%);
  padding: 3rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(210, 172, 42, 0.15);
}

.lotfi-archive-banner h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 700; color: var(--foreground); margin: 0 0 0.5rem; }
.lotfi-archive-banner h1 span { color: var(--maincolor); }
.lotfi-archive-banner p { color: #6b7280; font-size: 1rem; margin: 0; }

/* ============================================================
   BLOG POST CARDS
   ============================================================ */
.post-card {
  background: #fff;
  border: 1px solid var(--bordercolor);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease;
  will-change: transform;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.2);
  border-color: rgba(210, 172, 42, 0.2);
}

.post-card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--cardcolor);
}

.post-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .post-card-image-wrap img { transform: scale(1.045); }

.post-card-body { padding: 1.25rem 1.5rem 1.5rem; }

.post-card-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--maincolor);
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.post-card-category:hover { color: var(--background-color); }

.post-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.625rem;
  color: var(--foreground);
  font-family: var(--font-sans);
}

.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--maincolor); }

.post-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #6b7280;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #9ca3af;
}

.post-card-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #9ca3af; display: inline-block; }

.post-card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--maincolor);
  text-decoration: none;
  margin-top: 1rem;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--maincolor);
  border-radius: 50px;
  letter-spacing: 0.02em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  align-self: flex-start;
}
.post-card-read-more svg { transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.post-card-read-more:hover {
  background: var(--maincolor);
  color: #fff;
  gap: 0.65rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(186,145,48,0.28);
}
.post-card-read-more:hover svg { transform: translateX(4px); }

/* ============================================================
   FEATURED FIRST-POST HERO CARD
   ============================================================ */
.lotfi-featured-post {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--cardcolor);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 3rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  text-decoration: none;
}
.lotfi-featured-post:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.07);
  transform: translateY(-3px);
}

/* Side-by-side on tablet+ */
@media (min-width: 768px) {
  .lotfi-featured-post { grid-template-columns: 55% 1fr; }
}

/* Image side */
.lotfi-featured-image-wrap {
  display: block;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  text-decoration: none;
}
@media (min-width: 768px) {
  .lotfi-featured-image-wrap { min-height: 420px; }
}
.lotfi-featured-image-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.lotfi-featured-post:hover .lotfi-featured-image-wrap img {
  transform: scale(1.04);
}
.lotfi-featured-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(186,145,48,0.18) 0%, rgba(0,0,0,0.08) 100%);
  pointer-events: none;
}
.lotfi-featured-no-image {
  background: linear-gradient(135deg, var(--sectionBackground) 0%, var(--bordercolor) 100%);
  min-height: 280px;
}
@media (min-width: 768px) { .lotfi-featured-no-image { min-height: 420px; } }

/* Content side */
.lotfi-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 2rem 2.25rem;
}
@media (min-width: 1024px) {
  .lotfi-featured-body { padding: 2.5rem 2.5rem 2.75rem; gap: 1.25rem; }
}

.lotfi-featured-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.lotfi-featured-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maincolor);
  background: var(--background-transparent);
  border: 1px solid rgba(186,145,48,0.25);
  border-radius: 50px;
  padding: 0.3em 0.85em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.lotfi-featured-category:hover {
  background: var(--maincolor);
  color: #fff;
  text-decoration: none;
}
.lotfi-featured-reading {
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
}

.lotfi-featured-title {
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  color: var(--foreground);
}
.lotfi-featured-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.lotfi-featured-title a:hover { color: var(--maincolor); }

.lotfi-featured-excerpt {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.7;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lotfi-featured-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #9ca3af;
}
.lotfi-featured-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d1d5db;
  display: inline-block;
}
.lotfi-featured-author,
.lotfi-featured-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.lotfi-featured-author svg,
.lotfi-featured-date svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.lotfi-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  align-self: flex-start;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--maincolor);
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--maincolor);
  border-radius: 50px;
  transition: background 0.25s, color 0.25s, gap 0.25s;
}
.lotfi-featured-cta:hover {
  background: var(--maincolor);
  color: #fff;
  gap: 0.75rem;
  text-decoration: none;
}
.lotfi-featured-cta svg { transition: transform 0.25s; }
.lotfi-featured-cta:hover svg { transform: translateX(4px); }

/* Gold accent bar on the left edge of the content block */
.lotfi-featured-body::before {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background: linear-gradient(90deg, var(--maincolor), transparent);
  border-radius: 2px;
  margin-bottom: -0.25rem;
}

/* Posts grid */
.lotfi-posts-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px)  { .lotfi-posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .lotfi-posts-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   SINGLE POST CONTENT
   ============================================================ */
.entry-title-custom {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.entry-meta-custom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 1.5rem;
}

.entry-meta-custom a { color: var(--maincolor); text-decoration: none; }
.entry-meta-custom a:hover { color: var(--background-color); }
.entry-meta-custom .sep { width: 3px; height: 3px; border-radius: 50%; background: #9ca3af; display: inline-block; }

.entry-featured-image { border-radius: 0.75rem; overflow: hidden; margin-bottom: 2rem; }
.entry-featured-image img { width: 100%; height: auto; object-fit: cover; }

/* entry-content-custom, entry-tags, tag-link — full rules in SINGLE POST section below */

/* ============================================================
   PAGINATION
   ============================================================ */
.lotfi-pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 3rem; }

.lotfi-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: #374151;
  border: 1px solid var(--bordercolor);
  background: #fff;
  transition: all 0.2s;
}

.lotfi-pagination .page-numbers:hover { border-color: var(--maincolor); color: var(--maincolor); background: var(--sectionBackground); }
.lotfi-pagination .page-numbers.current { background: var(--maincolor); border-color: var(--maincolor); color: #fff; }
.lotfi-pagination .page-numbers.dots { border: none; background: none; cursor: default; }

/* ============================================================
   SIDEBAR & WIDGETS
   ============================================================ */
.widget-area .widget { margin-bottom: 2rem; padding: 1.25rem; background: var(--cardcolor); border: 1px solid var(--bordercolor); border-radius: 0.75rem; }
.widget-area .widget-title { font-size: 1rem; font-weight: 600; color: var(--foreground); margin-bottom: 1rem; padding-bottom: 0.625rem; border-bottom: 2px solid rgba(210,172,42,0.3); }
.widget-area ul { list-style: none; margin: 0; padding: 0; }
.widget-area ul li { border-bottom: 1px solid var(--bordercolor); padding: 0.5rem 0; }
.widget-area ul li:last-child { border-bottom: none; }
.widget-area ul li a { color: #4b5563; text-decoration: none; font-size: 0.9375rem; transition: color 0.2s; }
.widget-area ul li a:hover { color: var(--maincolor); }

.widget_search .search-form { display: flex; }
.widget_search .search-field { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--bordercolor); border-right: none; border-radius: 0.375rem 0 0 0.375rem; font-size: 0.875rem; background: #fff; outline: none; }
.widget_search .search-field:focus { border-color: var(--maincolor); }
.widget_search .search-submit { padding: 0.5rem 0.875rem; background: var(--maincolor); color: #fff; border: none; border-radius: 0 0.375rem 0.375rem 0; cursor: pointer; font-size: 0.875rem; font-weight: 500; }
.widget_search .search-submit:hover { background: var(--background-color); }

/* ============================================================
   COMMENTS
   ============================================================ */
/* ── Comments area — full card treatment matching sheet design ── */

/* Outer wrapper — same warm sheet bg, full-bleed */
.comments-area {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  border-top: none !important;
  background: #f5f3ef;
}

/* Inner centred column mirrors .lotfi-single width */
.comments-area > *,
.comments-area .comment-list,
.comments-area #respond {
  max-width: 760px;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* ── Comments inner column — shares the same side padding as the article ── */
.comments-area .comment-respond,
.comments-area .comments-title,
.comments-area .comment-list,
.comments-area #respond {
  max-width: 760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
}
@media (min-width: 640px) {
  .comments-area .comment-respond,
  .comments-area .comments-title,
  .comments-area .comment-list,
  .comments-area #respond {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}
@media (min-width: 768px) {
  .comments-area .comment-respond,
  .comments-area .comments-title,
  .comments-area .comment-list,
  .comments-area #respond {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
  }
}
@media (min-width: 1024px) {
  .comments-area .comment-respond,
  .comments-area .comments-title,
  .comments-area .comment-list,
  .comments-area #respond {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
}

/* ── "X Comments" title ── */
.comments-title {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem) !important;
  font-weight: 700 !important;
  color: var(--foreground) !important;
  margin: 0 !important;
  padding-top: 3rem !important;
  padding-bottom: 0 !important;
}

/* ── Comment list ── */
.comment-list {
  list-style: none !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 2rem !important;
}

.comment-list .comment {
  padding: 1.5rem 0 !important;
  border-bottom: 1px solid var(--bordercolor) !important;
  list-style: none !important;
}
.comment-list .comment:last-child { border-bottom: none !important; }

/* Nested reply indentation */
.comment-list .children {
  list-style: none !important;
  padding-left: 2rem !important;
  border-left: 2px solid rgba(210,172,42,0.2);
  margin-left: 1rem !important;
  margin-top: 1.25rem !important;
}

/* Comment header row */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.comment-author .fn {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--foreground);
}
.comment-author img {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(210,172,42,0.25) !important;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-metadata {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-left: auto;
}
.comment-metadata a { color: inherit; text-decoration: none; }
.comment-metadata a:hover { color: var(--maincolor); }

.comment-content p {
  font-size: 0.9375rem !important;
  line-height: 1.75 !important;
  color: #374151 !important;
  margin: 0 0 0.75rem !important;
}
.comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--maincolor);
  text-decoration: none;
  margin-top: 0.375rem;
  transition: color 0.2s;
}
.comment-reply-link:hover { color: var(--background-color); text-decoration: none; }

/* ── #respond — Leave a Comment card ── */
/* Side padding comes from the shared column rule above.
   We only set internal card padding (top/bottom) and visual treatment here. */
#respond {
  background: #fff !important;
  border: 1px solid var(--bordercolor) !important;
  border-radius: 1.25rem !important;
  padding: 2rem 2rem 2.5rem !important;
  margin-top: 0.5rem !important;
  margin-bottom: 3rem !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.05) !important;
  box-sizing: border-box !important;
  position: relative;
}
@media (min-width: 640px) {
  #respond { padding: 2rem 2rem 2.5rem !important; }
}
@media (min-width: 768px) {
  #respond { padding: 2.5rem 2.5rem 3rem !important; }
}

/* Gold top accent matching the sheet */
#respond::before {
  content: '';
  position: absolute;
  top: 0; left: 2rem;
  width: 3rem; height: 3px;
  background: linear-gradient(90deg, var(--maincolor), transparent);
  border-radius: 0 0 4px 4px;
}

/* "Leave a Comment" heading inside respond */
#respond .comment-reply-title {
  font-size: clamp(1.1rem, 2vw, 1.375rem) !important;
  font-weight: 700 !important;
  color: var(--foreground) !important;
  margin: 0 0 0.5rem !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#respond .comment-reply-title::before {
  content: '';
  display: inline-block;
  width: 0.25rem;
  height: 1.2em;
  background: var(--maincolor);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Logged-in-as / must-log-in notice */
#respond .logged-in-as,
#respond .must-log-in {
  font-size: 0.84rem !important;
  color: #6b7280 !important;
  background: var(--sectionBackground) !important;
  border: 1px solid rgba(210,172,42,0.18) !important;
  border-radius: 0.625rem !important;
  padding: 0.625rem 1rem !important;
  margin: 0 0 1.5rem !important;
  line-height: 1.6;
}
#respond .logged-in-as a,
#respond .must-log-in a {
  color: var(--maincolor) !important;
  text-decoration: none;
  font-weight: 600;
}
#respond .logged-in-as a:hover,
#respond .must-log-in a:hover { color: var(--background-color) !important; }

/* Comment form field labels */
.comment-form label {
  display: block !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #6b7280 !important;
  margin-bottom: 0.4rem !important;
}

/* All text inputs + textarea */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  border: 1.5px solid var(--bordercolor) !important;
  border-radius: 0.75rem !important;
  font-size: 0.9375rem !important;
  font-family: var(--font-body) !important;
  background: #fafaf8 !important;
  color: var(--foreground) !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  box-sizing: border-box !important;
  -webkit-appearance: none;
  appearance: none;
}
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  border-color: var(--maincolor) !important;
  box-shadow: 0 0 0 3px rgba(186,145,48,0.12) !important;
  background: #fff !important;
  outline: none !important;
}
.comment-form textarea {
  min-height: 9rem !important;
  resize: vertical !important;
  line-height: 1.7 !important;
}

/* Row for name + email side by side on wider screens */
.comment-form-fields-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 600px) {
  .comment-form-fields-row { grid-template-columns: 1fr 1fr; }
}

/* Individual field wrappers */
.comment-form p {
  margin: 0 0 1.125rem !important;
}
.comment-form p:last-of-type { margin-bottom: 0 !important; }

/* "Required fields are marked *" note */
.comment-notes {
  font-size: 0.8rem !important;
  color: #9ca3af !important;
  margin-bottom: 1.25rem !important;
}

/* Cookies consent checkbox */
.comment-form-cookies-consent {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.625rem !important;
  font-size: 0.8125rem !important;
  color: #6b7280 !important;
}
.comment-form-cookies-consent input[type="checkbox"] {
  width: auto !important;
  margin-top: 0.2rem !important;
  accent-color: var(--maincolor) !important;
}

/* Submit button */
.comment-form .form-submit { margin: 1.25rem 0 0 !important; }
.comment-form .submit,
.comment-form input[type="submit"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.75rem 2rem !important;
  background: var(--maincolor) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 50px !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  font-family: var(--font-body) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  letter-spacing: 0.02em !important;
  box-shadow: 0 4px 14px rgba(186,145,48,0.3) !important;
  -webkit-appearance: none;
  appearance: none;
}
.comment-form .submit:hover,
.comment-form input[type="submit"]:hover {
  background: var(--background-color) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(186,145,48,0.35) !important;
}
.comment-form .submit:active,
.comment-form input[type="submit"]:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(186,145,48,0.25) !important;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.lotfi-breadcrumbs { font-size: 0.8125rem; color: #9ca3af; margin-bottom: 1.5rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.375rem; }
.lotfi-breadcrumbs a { color: #9ca3af; text-decoration: none; transition: color 0.2s; }
.lotfi-breadcrumbs a:hover { color: var(--maincolor); }
.lotfi-breadcrumbs .sep { color: #d1d5db; font-size: 0.75rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.lotfi-footer {
  background: #fff;
  color: #374151;
  border-top: 1px solid rgba(51, 51, 51, 0.1);
  margin-top: 4rem;
}

.lotfi-footer-main { max-width: 1280px; margin: 0 auto; padding: 2.5rem 1rem; }
@media (min-width: 640px)  { .lotfi-footer-main { padding: 3rem 1.25rem; } }
@media (min-width: 1024px) { .lotfi-footer-main { padding: 3rem 2rem;    } }

.lotfi-footer-grid { display: flex; flex-direction: column; gap: 2rem; text-align: center; }

@media (min-width: 1024px) {
  .lotfi-footer-grid { flex-direction: row; flex-wrap: wrap; align-items: flex-start; text-align: left; gap: 1.5rem 2rem; }
}

/* Brand column */
.lotfi-footer-brand { display: flex; flex-direction: column; align-items: center; }
@media (min-width: 1024px) { .lotfi-footer-brand { align-items: flex-end; flex-shrink: 0; max-width: 200px; } }

.lotfi-footer-logo .custom-logo-link,
.lotfi-footer-logo a { display: block; text-decoration: none; margin-bottom: 0.75rem; }

.lotfi-footer-logo img,
.lotfi-footer-logo .custom-logo { width: auto; height: auto; max-width: 90px; max-height: 90px; object-fit: contain; }
@media (min-width: 640px) { .lotfi-footer-logo img, .lotfi-footer-logo .custom-logo { max-width: 110px; max-height: 110px; } }

.lotfi-footer-brand-name { font-size: 0.875rem; font-weight: 700; color: #1f2937; padding-top: 0.25rem; }
.lotfi-footer-copyright { margin-top: 1.5rem; font-size: 0.75rem; color: #9ca3af; }
.lotfi-footer-copyright strong { font-weight: 600; color: var(--maincolor); }

/* Footer nav columns */
.lotfi-footer-col h3 { font-size: 1rem; font-weight: 400; color: var(--maincolor); margin-bottom: 1rem; margin-top: 0; }
.lotfi-footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.lotfi-footer-col ul li a { font-size: 0.875rem; color: #374151; text-decoration: none; transition: color 0.2s; }
.lotfi-footer-col ul li a:hover { color: var(--maincolor); }

/* Contact items */
.lotfi-footer-contact-item { display: flex; align-items: flex-start; justify-content: center; gap: 0.75rem; font-size: 0.875rem; color: #374151; }
@media (min-width: 1024px) { .lotfi-footer-contact-item { justify-content: flex-start; } }
.lotfi-footer-contact-item svg { flex-shrink: 0; margin-top: 1px; color: #9ca3af; }
.lotfi-footer-contact-item a { color: #374151; text-decoration: none; transition: color 0.2s; }
.lotfi-footer-contact-item a:hover { color: var(--maincolor); }

/* Social icons */
.lotfi-footer-social { display: flex; justify-content: center; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 1024px) { .lotfi-footer-social { justify-content: flex-start; } }
.lotfi-footer-social a { display: inline-flex; align-items: center; justify-content: center; color: #d2ac2a; transition: color 0.2s, transform 0.2s; text-decoration: none; }
.lotfi-footer-social a:hover { color: var(--maincolor); transform: scale(1.1); }
.lotfi-footer-social svg { width: 20px; height: 20px; }

/* Payment strip */
.lotfi-footer-bottom { background: linear-gradient(to right, #09090b, #18181b, #09090b); border-top: 1px solid rgba(255,255,255,0.1); }

.lotfi-footer-bottom-inner { max-width: none; padding: 0 1rem; height: 40px; display: flex; align-items: center; justify-content: center; }

.lotfi-payment-logos { display: flex; align-items: center; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.lotfi-payment-logos::-webkit-scrollbar { display: none; }

.lotfi-payment-logo-item {
  display: flex; align-items: center; justify-content: center;
  height: 26px; min-height: 26px; max-height: 26px;
  width: auto; min-width: 28px; max-width: 100px;
  background: #fff; border-radius: 0.375rem; padding: 0 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); flex-shrink: 0;
}

.lotfi-payment-logo-item img { max-height: 22px; width: auto; max-width: 92px; height: auto; object-fit: contain; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed { opacity: 1; transform: translateY(0); }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .post-card, .scroll-reveal, .lotfi-mobile-menu, .lotfi-mobile-backdrop,
  .lotfi-search-overlay, .lotfi-search-box, .lotfi-primary-nav .sub-menu {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   BLOG MAIN WRAPPER
   ============================================================ */
.lotfi-blog-main {
  width: 100%;
  background: var(--background);
  min-height: 60vh;
}

/* No-posts message */
.lotfi-no-posts {
  text-align: center;
  padding: 4rem 1rem;
  color: #9ca3af;
  font-size: 1rem;
}

.lotfi-no-posts p { margin-bottom: 1.5rem; }

/* Inline search on search results page */
.lotfi-search-form-inline {
  display: flex;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

/* ============================================================
   POST CARD — extra polish matching Next.js cards
   ============================================================ */

/* Placeholder when no featured image */
.post-card-placeholder {
  width: 100%;
  height: 100%;
  background: radial-gradient(131.33% 138.78% at 115.47% -47.87%, #ffe7b0 0%, #faf7ee 100%);
  min-height: 200px;
}

/* The image link wrapper (no underline, full bleed) */
.post-card-image-link { display: block; text-decoration: none; }
.post-card-image-link:hover { text-decoration: none; }

/* ============================================================
   SINGLE POST — COMPLETE sp-* SYSTEM
   Each section owns its background/borders.
   Padding lives ONLY on .sp-inner — GP can never override it.
   ============================================================ */

/* ── Reading progress bar ── */
.sp-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--maincolor) 0%, var(--background-color) 100%);
  z-index: 10000;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Hero cover ── */
.sp-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  min-height: 460px;
  height: 70vh;
  max-height: 740px;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
  overflow: hidden;
  z-index: 1;
}
.sp-hero--no-img {
  background: linear-gradient(145deg, #1a1209 0%, #2d1f00 40%, #3a2800 100%);
}
.sp-hero--no-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 60% 40%, rgba(186,145,48,0.2) 0%, transparent 70%);
}
.sp-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.22) 40%, rgba(0,0,0,0.86) 100%);
  pointer-events: none;
}
.sp-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5.5rem;
  color: #fff;
  box-sizing: border-box;
}
@media (min-width: 640px)  { .sp-hero__inner { padding: 2rem 2rem 6rem; } }
@media (min-width: 1024px) { .sp-hero__inner { padding: 2.5rem 2.5rem 6.5rem; } }

.sp-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: color 0.2s, gap 0.2s;
}
.sp-hero__back:hover { color: #fff; gap: 0.55rem; text-decoration: none; }
.sp-hero__back svg { transition: transform 0.2s; }
.sp-hero__back:hover svg { transform: translateX(-3px); }

.sp-hero__cats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.sp-hero__cat {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(186,145,48,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: 0.3em 0.9em;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}
.sp-hero__cat:hover { background: var(--maincolor); text-decoration: none; color: #fff; }

.sp-hero__title {
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.18;
  color: #fff;
  margin: 0 0 1.5rem;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
  letter-spacing: -0.01em;
}

.sp-hero__meta {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.sp-hero__avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(186,145,48,0.75) !important;
  object-fit: cover;
  flex-shrink: 0;
}
.sp-hero__meta-text { display: flex; flex-direction: column; gap: 0.2rem; }
.sp-hero__author {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}
.sp-hero__author:hover { color: rgba(255,255,255,0.85); text-decoration: none; }
.sp-hero__meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
}
.sp-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,0.4); display: inline-block; }

/* ── Wrapper — lifted sheet ── */
.sp-wrapper {
  position: relative;
  display: block;
  width: 100%;
  background: #f7f5f1;
  border-radius: 2.5rem 2.5rem 0 0;
  margin-top: -3.5rem;
  z-index: 2;
  box-shadow: 0 -8px 48px rgba(0,0,0,0.22);
  box-sizing: border-box;
}
.sp-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 4rem; height: 3px;
  background: linear-gradient(90deg, transparent, var(--maincolor), transparent);
  border-radius: 0 0 4px 4px;
}

/* ── sp-inner: THE padding owner — GP cannot touch this ── */
.sp-inner {
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}
@media (min-width: 640px)  { .sp-inner { padding-left: 2rem;   padding-right: 2rem;   } }
@media (min-width: 768px)  { .sp-inner { padding-left: 2.5rem; padding-right: 2.5rem; } }
@media (min-width: 1024px) { .sp-inner { padding-left: 3rem;   padding-right: 3rem;   } }
.sp-inner--wide { max-width: 1240px; }

/* ── Article section ── */
.sp-article {
  padding-top: 3.5rem;
  padding-bottom: 0;
}
/* GP kill: the article element has WP post classes — strip structural GP styles */
.sp-wrapper .hentry,
.sp-wrapper .entry-content,
.sp-wrapper .entry-header,
.sp-wrapper .entry-footer {
  max-width: none !important;
  width: auto !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ── Article prose ── */
.sp-prose {
  font-size: 1.075rem;
  line-height: 1.88;
  color: #374151;
}
.sp-prose > * + * { margin-top: 1.5rem; }
.sp-prose > p { margin-top: 0; margin-bottom: 1.6rem; }

/* Drop-cap on the first paragraph */
.sp-prose > p:first-of-type::first-letter {
  float: left;
  font-size: 3.6em;
  font-weight: 800;
  line-height: 0.78;
  margin: 0.08em 0.1em 0 0;
  color: var(--maincolor);
  font-family: var(--font-sans);
}

.sp-prose h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--foreground);
  margin: 2.75rem 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--maincolor);
  line-height: 1.3;
}
.sp-prose h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--foreground);
  margin: 2.25rem 0 0.75rem;
}
.sp-prose h4 { font-size: 1.05rem; font-weight: 700; margin: 1.75rem 0 0.5rem; }
.sp-prose a { color: var(--maincolor); text-decoration: underline; text-underline-offset: 3px; }
.sp-prose a:hover { color: var(--background-color); }

.sp-prose ul, .sp-prose ol { margin: 0 0 1.5rem 0; padding: 0; }
.sp-prose ul li {
  list-style: none;
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.sp-prose ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--maincolor);
}
.sp-prose ol { padding-left: 1.5rem; }
.sp-prose ol li { margin-bottom: 0.5rem; }

.sp-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 2rem 0;
  display: block;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.sp-prose blockquote {
  margin: 2.5rem 0;
  padding: 1.75rem 1.75rem 1.75rem 2rem;
  background: linear-gradient(135deg, rgba(210,172,42,0.08) 0%, rgba(210,172,42,0.03) 100%);
  border-left: 4px solid var(--maincolor);
  border-radius: 0 1rem 1rem 0;
  font-style: italic;
  font-size: 1.1rem;
  color: #374151;
  line-height: 1.75;
  position: relative;
}
.sp-prose blockquote::before {
  content: '\201C';
  position: absolute;
  top: -0.25rem;
  left: 1rem;
  font-size: 4.5rem;
  color: var(--maincolor);
  opacity: 0.18;
  font-family: Georgia, serif;
  line-height: 1;
}
.sp-prose blockquote p { margin: 0; }
.sp-prose blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 600;
  color: var(--maincolor);
}

.sp-prose code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.15em 0.45em;
  font-size: 0.875em;
  color: var(--ctacolor);
}
.sp-prose pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 1rem;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}
.sp-prose pre code { background: none; border: none; padding: 0; color: inherit; }

.sp-prose hr {
  border: none;
  margin: 3rem 0;
  position: relative;
  height: 1px;
  background: var(--bordercolor);
}
.sp-prose hr::after {
  content: '◆';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--maincolor);
  font-size: 0.65rem;
  background: #f7f5f1;
  padding: 0 0.75rem;
}

.sp-prose table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: 0.9rem; }
.sp-prose th {
  background: var(--sectionBackground);
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--maincolor);
  color: var(--foreground);
}
.sp-prose td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--bordercolor); color: #374151; }
.sp-prose tr:last-child td { border-bottom: none; }

/* ── Tags ── */
.sp-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding: 1.125rem 1.25rem;
  background: #fff;
  border: 1px solid var(--bordercolor);
  border-radius: 0.875rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}
.sp-tags__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  flex-shrink: 0;
}
.sp-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--foreground);
  background: #f9f9f9;
  border: 1px solid var(--bordercolor);
  border-radius: 50px;
  padding: 0.3em 0.9em;
  text-decoration: none;
  transition: all 0.2s;
}
.sp-tag:hover { background: var(--maincolor); border-color: var(--maincolor); color: #fff; text-decoration: none; }

/* Also keep old .tag-link working (used in archive/search) */
.tag-link { display: inline-block; font-size: 0.78rem; font-weight: 500; color: var(--foreground); background: #f9f9f9; border: 1px solid var(--bordercolor); border-radius: 50px; padding: 0.3em 0.9em; text-decoration: none; transition: all 0.2s; }
.tag-link:hover { background: var(--maincolor); border-color: var(--maincolor); color: #fff; text-decoration: none; }

/* ── Author section ── */
.sp-author {
  background: linear-gradient(135deg, rgba(210,172,42,0.1) 0%, #fff 55%);
  border-top: 1px solid rgba(210,172,42,0.18);
  border-bottom: 1px solid rgba(210,172,42,0.12);
  margin-top: 3rem;
  padding: 2.5rem 0;
}
.sp-author__card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.sp-author__avatar-wrap {
  flex-shrink: 0;
  position: relative;
}
.sp-author__avatar-wrap::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--maincolor) 0%, var(--background-color) 50%, var(--maincolor) 100%);
  z-index: 0;
}
.sp-author__img {
  width: 88px !important;
  height: 88px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block;
  border: 3px solid #fff !important;
  position: relative;
  z-index: 1;
}
.sp-author__body { flex: 1; min-width: 0; }
.sp-author__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maincolor);
  margin: 0 0 0.3rem;
}
.sp-author__name {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--foreground);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.sp-author__name:hover { color: var(--maincolor); text-decoration: none; }
.sp-author__bio { font-size: 0.875rem; color: #6b7280; line-height: 1.65; margin: 0 0 1rem; }
.sp-author__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--maincolor);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: gap 0.2s, color 0.2s;
}
.sp-author__cta:hover { color: var(--background-color); gap: 0.65rem; text-decoration: none; }
.sp-author__cta svg { transition: transform 0.2s; }
.sp-author__cta:hover svg { transform: translateX(4px); }

/* ── Continue Reading nav section ── */
.sp-nav {
  background: #fff;
  border-bottom: 1px solid var(--bordercolor);
  padding: 2.5rem 0;
}
.sp-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maincolor);
  margin-bottom: 1.25rem;
}
.sp-nav__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 600px) { .sp-nav__grid { grid-template-columns: 1fr 1fr; } }

.sp-nav__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fafaf8;
  border: 1px solid var(--bordercolor);
  border-radius: 1rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.sp-nav__card:hover {
  border-color: rgba(210,172,42,0.45);
  background: rgba(255,252,245,1);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.09);
  text-decoration: none;
}
.sp-nav__card--next { flex-direction: row-reverse; }

.sp-nav__thumb {
  width: 72px;
  height: 72px;
  border-radius: 0.75rem;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  background-color: var(--bordercolor);
}
.sp-nav__thumb--empty { background: radial-gradient(circle, rgba(210,172,42,0.15), rgba(210,172,42,0.05)); }

.sp-nav__content { flex: 1; min-width: 0; }
.sp-nav__content--right { text-align: right; }

.sp-nav__dir {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--maincolor);
  margin-bottom: 0.4rem;
}
.sp-nav__dir--right { justify-content: flex-end; }

.sp-nav__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Related posts section ── */
.sp-related {
  background: linear-gradient(180deg, var(--sectionBackground) 0%, #f7f5f1 100%);
  border-top: 1px solid rgba(210,172,42,0.15);
  padding: 3.5rem 0 4rem;
}
.sp-related__heading { margin-bottom: 2rem; }
.sp-related__title {
  font-size: clamp(1.3rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: var(--foreground);
  margin: 0.4rem 0 0;
  position: relative;
  display: inline-block;
  padding-bottom: 0.625rem;
}
.sp-related__title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 2.5rem; height: 2px;
  background: var(--maincolor);
  border-radius: 2px;
}

/* ── Comments section ── */
.sp-comments {
  background: #f7f5f1;
  padding: 2rem 0 4rem;
}
.sp-comments__inner { max-width: 740px; }

/* ── Floating share strip (desktop left sidebar) ── */
.sp-share-strip {
  position: fixed;
  left: max(1rem, calc(50% - 420px - 3.5rem));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.sp-share-strip.visible { opacity: 1; pointer-events: auto; }
@media (max-width: 1100px) { .sp-share-strip { display: none; } }

.sp-share-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  writing-mode: vertical-lr;
  margin-bottom: 0.25rem;
}
.sp-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--bordercolor);
  color: #6b7280;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 0;
}
.sp-share-btn:hover {
  background: var(--maincolor);
  border-color: var(--maincolor);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(186,145,48,0.3);
  text-decoration: none;
}
.sp-share-copy.copied { background: var(--success); border-color: var(--success); color: #fff; }

/* ── Scroll-to-top button ── */
.sp-scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--maincolor);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(186,145,48,0.35);
  z-index: 500;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sp-scroll-top.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.sp-scroll-top:hover { background: var(--background-color); transform: translateY(-3px) scale(1.08); box-shadow: 0 8px 24px rgba(186,145,48,0.4); }

/* ── Single post page body background ── */
body.single-post { background: #f7f5f1 !important; }

/* ============================================================
   ARCHIVE BANNER — gold radial gradient matching Next.js
   ============================================================ */
.lotfi-archive-banner h1 span { color: var(--maincolor); }

/* ============================================================
   SEARCH RESULTS PAGE FORM
   ============================================================ */
.lotfi-search-form-inline {
  display: flex;
  gap: 0.625rem;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

/* ============================================================
   COMMENTS — extra overrides so WP default form looks brand-consistent
   ============================================================ */
#respond { margin-top: 3rem; }
#respond h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }

.comment-notes,
.comment-form label { font-size: 0.875rem; color: #6b7280; }

.comment-list .children { padding-left: 1.5rem; border-left: 2px solid rgba(210,172,42,0.15); margin-left: 0.5rem; list-style: none; }

/* ============================================================
   PAGE LINKS (multipage posts)
   ============================================================ */
.lotfi-page-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.lotfi-page-links a,
.lotfi-page-links span:not(:first-child) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: 1px solid var(--bordercolor);
  text-decoration: none;
  color: #374151;
  transition: all 0.2s;
}

.lotfi-page-links a:hover { border-color: var(--maincolor); color: var(--maincolor); background: var(--sectionBackground); }
.lotfi-page-links .post-page-numbers.current { background: var(--maincolor); border-color: var(--maincolor); color: #fff; }

/* ============================================================
   RESPONSIVE TYPOGRAPHY SCALE
   ============================================================ */
@media (max-width: 480px) {
  .entry-title-custom { font-size: 1.5rem; }
  .post-card-title    { font-size: 1rem;   }
  .lotfi-archive-banner h1 { font-size: 1.375rem; }
}

/* ============================================================
   REDUCED MOTION (append new selectors)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .lotfi-post-nav-item,
  .lotfi-back-link,
  .post-card-read-more,
  .lotfi-post-nav-item svg,
  .lotfi-back-link svg {
    animation: none !important;
    transition: none !important;
  }
}
