/* ── Notes (frontend) ───────────────────────────────────────── */
.pfe-single-notes {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
}
.pfe-notes-body {
    font-size: 0.97rem;
    color: #333;
    line-height: 1.7;
    background: #f7f5f2;
    border-left: 4px solid var(--pfe-green-dark, #2C4A2E);
    padding: 14px 18px;
    border-radius: 0 4px 4px 0;
}

/* ============================================================
   Painshawfield Planning Applications — Frontend Styles
   ============================================================ */

:root {
    --pfe-green-dark:  #2C4A2E;
    --pfe-green-mid:   #3a6641;
    --pfe-green-light: #d6e8d8;
    --pfe-warm-bg:     #f7f5f2;
    --pfe-border:      #d4d0cb;
    --pfe-text:        #1a1a1a;
    --pfe-muted:       #6b7280;
    --pfe-radius:      6px;
    --pfe-font-serif:  Georgia, 'Times New Roman', serif;
    --pfe-font-sans:   'Arial', sans-serif;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── No results ─────────────────────────────────────────── */
.pfe-no-results {
    font-family: var(--pfe-font-sans);
    color: var(--pfe-muted);
    padding: 24px;
    text-align: center;
    font-size: 14px;
}

/* ── Status badges (shared) ─────────────────────────────── */
.pfe-status-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-family: var(--pfe-font-sans);
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
    line-height: 1.8;
}
.pfe-status-pending   { background: #fff3cd; color: #7a5c00; }
.pfe-status-review    { background: #d6e8d8; color: #2C4A2E; }
.pfe-status-approved  { background: #d1ecf1; color: #0c5460; }
.pfe-status-deferred  { background: #f5e0e0; color: #7a2626; }
.pfe-status-refused   { background: #fee2e2; color: #7f1d1d; }
.pfe-status-withdrawn { background: #e5e7eb; color: #374151; }

/* ── Controls bar (shared) ──────────────────────────────── */
.pfe-table-controls,
.pfe-grid-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--pfe-warm-bg);
    border: 1px solid var(--pfe-border);
    border-radius: var(--pfe-radius);
}

.pfe-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pfe-filter-label {
    font-family: var(--pfe-font-sans);
    font-size: 12px;
    color: var(--pfe-muted);
    margin-right: 4px;
}

.pfe-filter-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--pfe-border);
    background: white;
    font-family: var(--pfe-font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--pfe-muted);
    cursor: pointer;
    transition: all .15s ease;
}
.pfe-filter-btn:hover {
    border-color: var(--pfe-green-mid);
    color: var(--pfe-green-dark);
}
.pfe-filter-btn.active {
    background: var(--pfe-green-dark);
    border-color: var(--pfe-green-dark);
    color: white;
}

.pfe-search {
    padding: 7px 14px;
    border: 1.5px solid var(--pfe-border);
    border-radius: 20px;
    font-family: var(--pfe-font-sans);
    font-size: 13px;
    color: var(--pfe-text);
    background: white;
    min-width: 200px;
    transition: border-color .15s;
}
.pfe-search:focus {
    outline: none;
    border-color: var(--pfe-green-mid);
    box-shadow: 0 0 0 3px rgba(44,74,46,.1);
}

/* ============================================================
   TABLE VIEW
   ============================================================ */

.pfe-table-wrap { font-family: var(--pfe-font-sans); }

.pfe-applications-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pfe-applications-table thead th {
    background: var(--pfe-green-dark);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 700;
}

.pfe-applications-table thead th.pfe-sortable {
    cursor: pointer;
    user-select: none;
}
.pfe-applications-table thead th.pfe-sortable:hover { background: #3a6641; }
.sort-icon { opacity: .6; font-size: 10px; margin-left: 4px; }
.sort-icon.asc::after  { content: '↑'; }
.sort-icon.desc::after { content: '↓'; }

.pfe-app-row {
    border-bottom: 1px solid var(--pfe-border);
    transition: background .12s ease;
    cursor: pointer;
}
.pfe-app-row:hover { background: #f0f5f0; }
.pfe-app-row.hidden { display: none; }

.pfe-applications-table tbody td {
    padding: 13px 16px;
    vertical-align: middle;
    line-height: 1.4;
}

.pfe-applications-table tbody tr:nth-child(even) { background: #fafaf8; }
.pfe-applications-table tbody tr:nth-child(even):hover { background: #f0f5f0; }

.pfe-address-text {
    display: block;
    color: var(--pfe-text);
    font-weight: 700;
    font-size: 13.5px;
}
.pfe-ref-code {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--pfe-muted);
    margin-top: 2px;
}

.col-description { color: #444; max-width: 320px; line-height: 1.5; }
.col-submitted   { white-space: nowrap; color: var(--pfe-muted); font-size: 13px; }
.col-action      { text-align: right; white-space: nowrap; }

.pfe-view-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--pfe-green-mid);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    padding: 6px 14px;
    border: 1.5px solid var(--pfe-green-light);
    border-radius: 20px;
    transition: all .15s;
}
.pfe-view-link:hover {
    background: var(--pfe-green-dark);
    border-color: var(--pfe-green-dark);
    color: white;
}
.pfe-arrow { transition: transform .15s; }
.pfe-view-link:hover .pfe-arrow { transform: translateX(3px); }

.pfe-table-note {
    font-size: 12px;
    color: var(--pfe-muted);
    margin-top: 12px;
    font-style: italic;
    text-align: right;
}

/* ============================================================
   GRID VIEW
   ============================================================ */

.pfe-grid-wrap { font-family: var(--pfe-font-sans); }

.pfe-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}
.pfe-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.pfe-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.pfe-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .pfe-grid-cols-3,
    .pfe-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .pfe-grid { grid-template-columns: 1fr !important; }
    .pfe-table-controls,
    .pfe-grid-controls { flex-direction: column; align-items: flex-start; }
    .pfe-search { min-width: 100%; }
}

.pfe-card {
    background: white;
    border: 1px solid var(--pfe-border);
    border-radius: var(--pfe-radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s ease, transform .2s ease;
}
.pfe-card:hover {
    box-shadow: 0 6px 20px rgba(44,74,46,.14);
    transform: translateY(-2px);
}
.pfe-card.hidden { display: none; }

.pfe-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.pfe-card-header {
    position: relative;
    background: var(--pfe-green-dark);
    min-height: 140px;
    overflow: hidden;
}

.pfe-card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
}
.pfe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(.85);
    transition: filter .3s, transform .3s;
}
.pfe-card:hover .pfe-card-image img {
    filter: brightness(.95);
    transform: scale(1.03);
}
.pfe-card-image--placeholder {
    background: linear-gradient(135deg, #2C4A2E 0%, #3a6641 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pfe-placeholder-icon {
    font-size: 48px;
    opacity: .35;
}

.pfe-card-header .pfe-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.pfe-card-body {
    padding: 18px 20px 12px;
    flex: 1;
}

.pfe-card-ref {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--pfe-muted);
    display: block;
    margin-bottom: 6px;
}

.pfe-card-address {
    font-family: var(--pfe-font-serif);
    font-size: 16px;
    font-weight: normal;
    color: var(--pfe-green-dark);
    margin: 0 0 8px;
    line-height: 1.3;
}

.pfe-card-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
    margin: 0;
}

.pfe-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--pfe-border);
    background: var(--pfe-warm-bg);
    font-size: 12px;
    flex-wrap: wrap;
}

.pfe-card-date { color: var(--pfe-muted); }

.pfe-card-docs {
    color: var(--pfe-muted);
    padding: 2px 8px;
    background: var(--pfe-green-light);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--pfe-green-dark);
}

.pfe-card-cta {
    margin-left: auto;
    color: var(--pfe-green-mid);
    font-weight: 700;
    font-size: 12.5px;
    transition: gap .15s;
}
.pfe-card:hover .pfe-card-cta { letter-spacing: .02em; }

/* ── Pagination ─────────────────────────────────────────── */
.pfe-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.pfe-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid var(--pfe-border);
    border-radius: var(--pfe-radius);
    font-family: var(--pfe-font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--pfe-text);
    text-decoration: none;
    background: white;
    transition: all .15s;
}
.pfe-pagination .page-numbers:hover,
.pfe-pagination .page-numbers.current {
    background: var(--pfe-green-dark);
    border-color: var(--pfe-green-dark);
    color: white;
}

/* ============================================================
   SINGLE APPLICATION DETAIL
   ============================================================ */

.pfe-single-wrap {
    font-family: var(--pfe-font-sans);
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.pfe-single-breadcrumb {
    font-size: 12.5px;
    color: var(--pfe-muted);
    margin-bottom: 28px;
}
.pfe-single-breadcrumb a {
    color: var(--pfe-green-mid);
    text-decoration: none;
}
.pfe-single-breadcrumb a:hover { text-decoration: underline; }
.pfe-single-breadcrumb span { margin: 0 6px; }

.pfe-single-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--pfe-green-light);
}

.pfe-single-ref {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--pfe-muted);
}

/* Meta grid */
.pfe-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.pfe-meta-item {
    background: var(--pfe-warm-bg);
    border: 1px solid var(--pfe-border);
    border-radius: var(--pfe-radius);
    padding: 14px 16px;
}
.pfe-meta-item .meta-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--pfe-muted);
    margin-bottom: 5px;
}
.pfe-meta-item .meta-value {
    font-size: 14px;
    color: var(--pfe-text);
    font-weight: 600;
    line-height: 1.3;
}

/* Description */
.pfe-single-description {
    margin-bottom: 36px;
}
.pfe-single-description h2 {
    font-family: var(--pfe-font-serif);
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--pfe-green-dark);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pfe-border);
}
.pfe-single-description .pfe-desc-text {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

/* Full content from editor */
.pfe-single-content {
    margin-bottom: 36px;
    font-size: 15px;
    line-height: 1.75;
    color: #333;
}
.pfe-single-content h2,
.pfe-single-content h3 {
    font-family: var(--pfe-font-serif);
    color: var(--pfe-green-dark);
    font-weight: normal;
    margin-top: 28px;
}

/* Documents */
.pfe-single-documents { margin-bottom: 36px; }
.pfe-single-documents h2 {
    font-family: var(--pfe-font-serif);
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--pfe-green-dark);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pfe-border);
}

.pfe-doc-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Kill any theme bullet-point bleed */
.pfe-doc-list li,
.pfe-doc-list .pfe-doc-item {
    list-style: none !important;
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}
.pfe-doc-list li::before,
.pfe-doc-list .pfe-doc-item::before {
    display: none !important;
    content: none !important;
}

.pfe-doc-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--pfe-warm-bg);
    border: 1px solid var(--pfe-border);
    border-radius: var(--pfe-radius);
    text-decoration: none;
    color: var(--pfe-text);
    transition: all .15s;
}
.pfe-doc-item a:hover {
    border-color: var(--pfe-green-mid);
    background: #eef5ef;
}

.pfe-doc-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--pfe-green-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.pfe-doc-info { flex: 1; }
.pfe-doc-info .doc-label { display: block; font-weight: 700; font-size: 14px; }
.pfe-doc-info .doc-type  { display: block; font-size: 11.5px; color: var(--pfe-muted); text-transform: capitalize; margin-top: 2px; }

.pfe-doc-arrow {
    color: var(--pfe-green-mid);
    font-size: 18px;
    transition: transform .15s;
}
.pfe-doc-item a:hover .pfe-doc-arrow { transform: translateX(4px); }

/* Back link */
.pfe-single-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pfe-green-mid);
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    padding: 10px 20px;
    border: 1.5px solid var(--pfe-green-light);
    border-radius: 4px;
    transition: all .15s;
    margin-top: 16px;
}
.pfe-single-back:hover {
    background: var(--pfe-green-dark);
    border-color: var(--pfe-green-dark);
    color: white;
}

/* ── Injected planning sidebar nav ─────────────────────────── */
.pfe-injected-sidebar-widget {
    display: none; /* shown only on application pages via inline CSS */
}

.pfe-sidebar-nav {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pfe-sidebar-nav li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--pfe-border);
}

.pfe-sidebar-nav li:first-child {
    border-top: 1px solid var(--pfe-border);
}

.pfe-sidebar-nav li a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--pfe-green-mid);
    text-decoration: none;
    transition: background .12s, color .12s;
}

.pfe-sidebar-nav li a:hover {
    background: var(--pfe-green-light);
    color: var(--pfe-green-dark);
}

.pfe-sidebar-nav li.current-menu-item a {
    background: var(--pfe-green-light);
    color: var(--pfe-green-dark);
    font-weight: 700;
    border-left: 3px solid var(--pfe-green-dark);
    padding-left: 11px;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pfe-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 8px;
    padding: 12px 0;
    border-top: 1px solid var(--pfe-border);
}

.pfe-page-btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--pfe-green-mid);
    border-radius: 4px;
    color: var(--pfe-green-mid);
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .12s, color .12s;
}

.pfe-page-btn:hover {
    background: var(--pfe-green-dark);
    border-color: var(--pfe-green-dark);
    color: white;
    text-decoration: none;
}

.pfe-page-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
    border-color: var(--pfe-border);
    color: var(--pfe-muted);
}

.pfe-page-info {
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: var(--pfe-muted);
}

/* ── Single page breadcrumb ─────────────────────────────────── */
.pfe-breadcrumb {
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: var(--pfe-muted);
    margin-bottom: 16px;
}

.pfe-breadcrumb a {
    color: var(--pfe-green-mid);
    text-decoration: none;
}

.pfe-breadcrumb a:hover {
    text-decoration: underline;
}

.pfe-bc-sep {
    margin: 0 6px;
    color: var(--pfe-muted);
}

/* ── Fix left indent on single application page ─────────────── */
/* The theme wraps content in entry-content which can add padding */
.single-pfe_application .entry-content,
.single-pfe_application .is_single.entry-content {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.pfe-single-wrap {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* ── Document groups (frontend) ─────────────────────────────── */
.pfe-doc-group { margin-bottom: 20px; }

.pfe-doc-group-title {
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pfe-green-dark);
    margin: 0 0 8px;
    padding: 6px 0;
    border-bottom: 2px solid var(--pfe-green-light, #d6e8d8);
}
