/*
Theme Name: Sri Lanka Gov Directory
Theme URI: https://govdirectory.lk
Author: Priyamal
Description: A custom, lightweight directory theme for Sri Lankan Government Institutions.
Version: 1.0.0
Text Domain: gov-directory
*/

:root {
  --primary: #0b3c5d;
  --primary-dark: #07273d;
  --accent: #2563eb;
  --bg-light: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: #ffffff;
}

* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: #ffffff; border-bottom: 1px solid #e2e8f0; padding: 18px 0; }
.site-header h1 { margin: 0; font-size: 1.4rem; }
.site-header a { text-decoration: none; color: var(--primary); font-weight: 700; }

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  padding: 60px 0;
  text-align: center;
}
.hero-section h1 { font-size: 2.2rem; margin-bottom: 10px; }
.hero-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 30px; }

/* Search Form */
.hero-search-form {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 0.8fr;
  gap: 10px;
  background: #ffffff;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.hero-search-form input, .hero-search-form select {
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
}
.hero-search-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.hero-search-form button:hover { background: #1d4ed8; }

/* Category Grid */
.categories-section { padding: 50px 0; }
.categories-section h2, .recent-institutions h2 { font-size: 1.6rem; margin-bottom: 25px; color: var(--primary); }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.cat-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: var(--text-main);
  text-align: center;
  transition: all 0.2s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 15px rgba(0,0,0,0.06); border-color: var(--accent); }
.cat-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.cat-card h3 { margin: 6px 0; font-size: 1.1rem; }
.cat-count { font-size: 0.85rem; color: var(--text-muted); }

/* Institution Cards */
.recent-institutions { padding: 20px 0 60px 0; }
.institutions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.institution-card {
  background: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.institution-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.badge { align-self: flex-start; font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.dist-badge { background: #fef3c7; color: #b45309; }
.institution-card h3 { margin: 12px 0 8px 0; font-size: 1.15rem; }
.institution-card h3 a { color: var(--text-main); text-decoration: none; }
.card-address { color: var(--text-muted); font-size: 0.88rem; margin: 4px 0; }
.card-hotline { color: #059669; font-size: 0.95rem; margin: 6px 0 16px 0; }
.btn-view { margin-top: auto; display: block; text-align: center; background: #f1f5f9; border: 1px solid #cbd5e1; padding: 10px; border-radius: 6px; text-decoration: none; color: var(--text-main); font-weight: 600; }
.btn-view:hover { background: var(--primary); color: #fff; }

/* Single Institution View */
.single-institution-wrap { padding: 40px 20px; }
.inst-card { background: #fff; border-radius: 10px; padding: 30px; border: 1px solid #e2e8f0; }
.inst-details-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; margin-top: 25px; }
.inst-info-sidebar { background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; }
.inst-info-sidebar ul { list-style: none; padding: 0; margin: 0; }
.inst-info-sidebar li { margin-bottom: 12px; font-size: 0.95rem; }

/* Footer */
.site-footer { background: #0f172a; color: #94a3b8; padding: 30px 0; text-align: center; font-size: 0.9rem; margin-top: 50px; }

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-search-form { grid-template-columns: 1fr; }
  .inst-details-grid { grid-template-columns: 1fr; }
}

/* Contact Sidebar */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { margin-bottom: 14px; font-size: 0.92rem; }
.contact-list strong { display: block; margin-bottom: 4px; color: #334155; }
.contact-links-group { display: flex; flex-direction: column; gap: 4px; }
.contact-links-group a, .contact-list a { color: #0284c7; text-decoration: none; word-break: break-all; }
.contact-links-group a:hover, .contact-list a:hover { text-decoration: underline; }
.highlight-hotline { font-size: 1.1rem; font-weight: 700; color: #dc2626 !important; }

/* Internal Directory Table */
.table-responsive { width: 100%; overflow-x: auto; margin-top: 12px; border-radius: 8px; border: 1px solid #e2e8f0; }
.directory-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.92rem; background: #fff; }
.directory-table th { background: #f8fafc; padding: 12px 14px; font-weight: 600; color: #1e293b; border-bottom: 2px solid #e2e8f0; }
.directory-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.directory-table tr:hover td { background: #f8fafc; }
.directory-table .font-semibold { font-weight: 600; color: #0f172a; }
.service-box { background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; margin-bottom: 25px; }

/* ===================================================
   Modern & Clean Pagination Buttons
   =================================================== */
.pagination-wrap,
.navigation.pagination {
    margin: 50px 0 30px 0;
    text-align: center;
    width: 100%;
    clear: both;
}

/* Hide default screen-reader text added by WordPress */
.navigation.pagination .screen-reader-text {
    display: none;
}

/* Pagination container list */
.pagination-wrap .nav-links,
.navigation.pagination .nav-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Base style for all page buttons (Numbers, Prev, Next, Dots) */
.pagination-wrap .page-numbers,
.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

/* Hover Effect for clickable pages */
.pagination-wrap a.page-numbers:hover,
.navigation.pagination a.page-numbers:hover {
    background-color: #0b3c5d;
    color: #ffffff;
    border-color: #0b3c5d;
    box-shadow: 0 4px 10px rgba(11, 60, 93, 0.2);
    transform: translateY(-2px);
}

/* Current / Active Page Button */
.pagination-wrap .page-numbers.current,
.navigation.pagination .page-numbers.current {
    background-color: #0b3c5d;
    color: #ffffff;
    border-color: #0b3c5d;
    box-shadow: 0 4px 8px rgba(11, 60, 93, 0.25);
    cursor: default;
}

/* Dots (...) Styling */
.pagination-wrap .page-numbers.dots,
.navigation.pagination .page-numbers.dots {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #94a3b8;
    min-width: 24px;
    cursor: default;
}

/* Next & Previous Buttons */
.pagination-wrap .page-numbers.prev,
.pagination-wrap .page-numbers.next,
.navigation.pagination .page-numbers.prev,
.navigation.pagination .page-numbers.next {
    padding: 0 18px;
    background-color: #f8fafc;
    border-color: #cbd5e1;
    font-weight: 600;
}

.pagination-wrap a.page-numbers.prev:hover,
.pagination-wrap a.page-numbers.next:hover,
.navigation.pagination a.page-numbers.prev:hover,
.navigation.pagination a.page-numbers.next:hover {
    background-color: #0b3c5d;
    color: #ffffff;
    border-color: #0b3c5d;
}