/**
 * Emma Grace Mom Life — extra.css  v1.0.2
 * Supplemental: WP core classes, comment list, pagination, Gutenberg, CF7, print.
 * FIX 5 additions: extra specificity for WP-generated nav active classes.
 */

/* ============================================================
   FIX 5 — WP nav active classes — calm shiny terracotta underline style
   ============================================================ */
.nav-list .current-menu-item > a,
.nav-list .current-menu-ancestor > a,
.nav-list .current_page_item > a,
.nav-list .current_page_ancestor > a,
.nav-list .current-cat > a,
.nav-list .current-cat-ancestor > a {
  color: #C4694A !important;
  background: transparent !important;
  border-radius: 6px;
  position: relative;
}
/* Soft shimmer underline on active nav item */
.nav-list .current-menu-item > a::after,
.nav-list .current-menu-ancestor > a::after,
.nav-list .current_page_item > a::after,
.nav-list .current-cat > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10px; right: 10px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #C4694A, #e8a090, #C4694A, transparent);
  background-size: 200% auto;
  animation: navUnderlineShine 2.5s ease-in-out infinite;
}
@keyframes navUnderlineShine {
  0%   { background-position: 0% center; }
  50%  { background-position: 100% center; }
  100% { background-position: 0% center; }
}

.mobile-nav-list .current-menu-item > a,
.mobile-nav-list .current_page_item > a,
.mobile-nav-list .current-cat > a {
  color: #C4694A !important;
}

/* ============================================================
   WORDPRESS CORE ALIGNMENT CLASSES
   ============================================================ */
.alignleft  { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1rem auto; text-align: center; }
.alignwide  { margin-left: -40px; margin-right: -40px; }
.alignfull  { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); width: 100vw; max-width: 100vw; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-top: 6px; font-style: italic; }
.sticky { /* WordPress sticky post indicator */ }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 1.5rem 0; }
.gallery-item { overflow: hidden; border-radius: var(--radius-sm); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   COMMENTS LIST
   ============================================================ */
.comment-list { list-style: none; margin: 0 0 28px; }
.comment-list .comment {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
.comment-list .comment:last-child { border-bottom: none; }
.comment-list .comment img.avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.comment-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.comment-meta .comment-author b { font-weight: 600; color: var(--charcoal); font-size: 0.92rem; }
.comment-meta .comment-metadata { display: inline; margin-left: 8px; }
.comment-content p { font-size: 0.92rem; line-height: 1.7; }
.reply a {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-top: 6px;
    display: inline-block;
    transition: opacity 0.2s;
}
.reply a:hover { opacity: 0.7; }

/* ============================================================
   WORDPRESS PAGINATION
   ============================================================ */
.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px; height: 38px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--charcoal);
    border: 1.5px solid var(--border);
    transition: all 0.2s;
    padding: 0 10px;
}
.page-numbers:hover { border-color: var(--terracotta); color: var(--terracotta); }
.page-numbers.current { background: var(--charcoal); color: white; border-color: var(--charcoal); }
.page-numbers.dots { border: none; }

/* ============================================================
   SEARCH FORM (WordPress default override)
   ============================================================ */
.search-form { display: flex; gap: 0; }
.search-form label { flex: 1; }
.search-form .search-submit {
    background: var(--charcoal);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0 40px 40px 0;
    transition: background 0.2s;
}
.search-form .search-submit:hover { background: var(--olive); }
.search-form .search-field {
    flex: 1;
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: 40px 0 0 40px;
    padding: 10px 18px;
    font-size: 0.92rem;
    color: var(--charcoal);
    background: white;
    outline: none;
    transition: border-color 0.2s;
}
.search-form .search-field:focus { border-color: var(--terracotta); }

/* ============================================================
   GUTENBERG BLOCKS BASIC SUPPORT
   ============================================================ */
.wp-block-quote {
    border-left: 3px solid var(--terracotta);
    padding: 12px 20px;
    background: var(--beige-card);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1.5rem 0;
}
.wp-block-quote p { font-style: italic; color: var(--text-muted); margin: 0; }
.wp-block-quote cite { font-size: 0.82rem; color: var(--text-muted); display: block; margin-top: 6px; }
.wp-block-pullquote { text-align: center; padding: 2rem; }
.wp-block-pullquote blockquote { border: none; background: none; }
.wp-block-separator { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.wp-block-separator.is-style-wide { border-top-width: 2px; border-color: var(--terracotta); }
.wp-block-image img { border-radius: var(--radius-sm); }
.wp-block-image figcaption { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-top: 6px; }
.wp-block-code {
    background: var(--beige-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-size: 0.88rem;
    overflow-x: auto;
}
.wp-block-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.wp-block-table th, .wp-block-table td { padding: 10px 14px; border: 1px solid var(--border); font-size: 0.9rem; }
.wp-block-table th { background: var(--beige-card); font-weight: 600; }
.wp-block-table tr:nth-child(even) td { background: var(--cream); }

/* ============================================================
   CF7 FORM OVERRIDES
   ============================================================ */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
    width: 100%;
    background: var(--beige-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--charcoal);
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}
.wpcf7 input:focus, .wpcf7 textarea:focus { border-color: var(--terracotta); background: white; }
.wpcf7 textarea { min-height: 140px; resize: vertical; }
.wpcf7 input[type="submit"] {
    display: inline-flex;
    align-items: center;
    background: var(--charcoal);
    color: white;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 14px 28px;
    border-radius: 40px;
    cursor: pointer;
    transition: background 0.2s;
}
.wpcf7 input[type="submit"]:hover { background: var(--olive); }
.wpcf7-response-output {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}
.wpcf7-mail-sent-ok { background: #E8F5E9; border: 1px solid #A5D6A7; color: #2E7D32; }
.wpcf7-validation-errors { background: #FFF3E0; border: 1px solid #FFCC80; color: #E65100; }

/* ============================================================
   SMOOTH TRANSITION FOR AJAX POST LOAD
   ============================================================ */
#posts-grid {
    transition: opacity 0.2s ease;
}
#posts-grid .post-card {
    animation: cardFadeIn 0.35s ease both;
}
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FOCUS VISIBLE (ACCESSIBILITY)
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--terracotta);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .announcement-bar,
    .site-header,
    .category-bar-wrap,
    .sidebar,
    .carousel-section,
    .feature-strip,
    .site-footer,
    .scroll-top,
    .comment-form-wrap,
    .author-box { display: none !important; }

    .content-wrapper { grid-template-columns: 1fr !important; }
    body { background: white; color: black; font-size: 12pt; }
    a { color: black; text-decoration: underline; }
    .entry-content img { max-width: 60%; }
}

/* ===== SIDEBAR LAYOUT ===== */
.content-wrapper {
  align-items: start !important;
}

/* Homepage sidebar — sticky, stays on screen as you scroll */
.content-wrapper > .sidebar:not(.single-sidebar) {
  position: sticky !important;
  top: 100px !important;
  align-self: start !important;
  max-height: none !important;
  overflow: visible !important;
  height: auto !important;
}

/* Single post sidebar — scrolls normally with the page */
.single-sidebar {
  position: static !important;
  top: auto !important;
  align-self: auto !important;
  max-height: none !important;
  overflow: visible !important;
  height: auto !important;
}
