/* Modern 2026 Theme for RIP.com.mt */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Rokkitt:wght@400;700&display=swap');

:root {
    /* Brand Colors */
    --primary-purple: #62487c;
    --primary-purple-dark: #4d3a61;
    --primary-purple-light: #eaddf5;

    /* Neutral Colors */
    --bg-body: #f7f7f7;
    --bg-card: #ffffff;
    --text-main: #2c2c2c;
    --text-muted: #666666;
    --border-color: #eaeaea;

    /* Spacing & Layout */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.08);
}

/* Override Bootstrap 3's html { font-size: 10px } so 1rem = 16px */
html {
    font-size: 16px !important;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Rokkitt', serif;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--primary-purple);
    line-height: 1.3;
}

a {
    transition: all 0.2s ease;
    color: var(--primary-purple);
    text-decoration: none;
}

a:hover {
    color: var(--primary-purple-dark);
}

/* Layout Wrapper */
.modern-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: var(--spacing-lg);
}

@media (max-width: 768px) {
    .modern-container {
        grid-template-columns: 1fr;
    }
}

/* ── Main Navbar (Bootstrap 5) ── */
#rip-custom-menu {
    background-color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

#rip-custom-menu .nav-link {
    color: var(--primary-purple) !important;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.3px;
    padding: 8px 14px;
    border-radius: 20px;
    margin: 4px 2px;
    transition: all 0.2s ease;
}

#rip-custom-menu .nav-link:hover,
#rip-custom-menu .nav-link:focus {
    color: var(--primary-purple-dark) !important;
    background-color: var(--primary-purple-light) !important;
}

#rip-custom-menu .nav-link.active {
    color: #fff !important;
    background-color: var(--primary-purple) !important;
}

/* Open dropdown state */
#rip-custom-menu .nav-item.show > .nav-link,
#rip-custom-menu .nav-item.show > .nav-link:hover {
    color: var(--primary-purple-dark) !important;
    background-color: var(--primary-purple-light) !important;
}

/* Dropdown */
#rip-custom-menu .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    margin-top: 4px;
}

#rip-custom-menu .dropdown-item {
    color: var(--text-main);
    padding: 10px 20px;
    font-size: 15px;
    transition: all 0.2s ease;
}

#rip-custom-menu .dropdown-item:hover,
#rip-custom-menu .dropdown-item:focus {
    background-color: var(--primary-purple-light);
    color: var(--primary-purple);
    padding-left: 24px;
}

/* Navbar toggler (mobile) */
#rip-custom-menu .navbar-toggler {
    border: 2px solid var(--primary-purple);
    border-radius: 8px;
    padding: 6px 10px;
}

#rip-custom-menu .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(98, 72, 124, 0.2);
}

#rip-custom-menu .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2362487c' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile collapse */
#rip-custom-menu .navbar-collapse {
    background-color: #fff;
}

@media (max-width: 991px) {
    #rip-custom-menu .navbar-collapse {
        border-top: 1px solid #eee;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
        padding: 8px 0;
    }
}

.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0 15px 0 0;
}

.navbar-brand img {
    height: 55px;
    width: auto;
    padding: 6px 0;
}

/* Hero Section */
.hero-modern {
    background-image: url("../img/malta2.jpg");
    background-size: cover;
    background-position: center;
    position: relative;
    text-align: center;
    color: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

/* Tall hero for homepage */
.hero-modern.hero-tall {
    padding: 50px 20px;
}

/* Compact hero for other pages */
.hero-modern.hero-compact {
    padding: 30px 20px;
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(98, 72, 124, 0.7);
    /* Purple overlay */
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-search-wrapper {
    background: white;
    padding: var(--spacing-sm);
    border-radius: 50px;
    /* Pill shape */
    display: inline-flex;
    align-items: center;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 500px;
    margin-top: var(--spacing-md);
}

.hero-search-input {
    border: none;
    flex-grow: 1;
    padding: 10px 20px;
    border-radius: 50px;
    outline: none;
    font-size: 16px;
    color: var(--text-main);
}

.rip-color {
    color: rgba(255, 255, 255, 0.7) !important;
    margin-right: 5px;
}

.active .rip-color,
a:hover .rip-color {
    color: white !important;
}

.hero-search-btn {
    background: var(--primary-purple);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.hero-search-btn:hover {
    background: var(--primary-purple-dark);
}

/* Listing Grid */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

/* Obituary Card */
.obit-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.obit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.obit-image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.obit-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s;
    filter: grayscale(10%);
}

.obit-card:hover .obit-image {
    filter: grayscale(0%);
}

.obit-content {
    padding: var(--spacing-md);
    text-align: center;
}

.obit-name {
    font-family: 'Rokkitt', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-main);
    line-height: 1.2;
}

.obit-dates {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.obit-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--primary-purple-light);
    color: var(--primary-purple);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.obit-status-verified {
    color: #27ae60;
    font-size: 0.8rem;
    margin-top: var(--spacing-xs);
    display: block;
}

/* Sidebar Ads */
.sidebar-ad-spots {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.ad-placeholder {
    background: #fff;
    border: 1px dashed #ccc;
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

/* Buttons */
.btn-modern {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--primary-purple);
    color: white;
    border-radius: 20px;
    font-weight: 500;
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-modern:hover {
    background-color: var(--primary-purple-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Footer Refinements */
footer {
    background-color: var(--primary-purple);
    color: white;
    padding: 50px 0 30px;
    margin-top: 40px;
    text-align: left !important;
}

footer .footer-row {
    text-align: left !important;
    padding: 0;
    margin-bottom: 0;
}

footer h3 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 10px;
    margin-bottom: 16px;
    text-align: left;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

footer ul li {
    text-align: left !important;
    list-style-type: none;
}

footer ul li a {
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 0;
    display: block;
    font-size: 0.9rem;
}

footer ul li a:hover {
    color: white;
    padding-left: 6px;
}

footer .footer-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center !important;
}

footer .footer-text a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    margin: 0 6px;
    transition: color 0.2s;
}

footer .footer-text a:hover {
    color: white;
    padding-left: 0;
}

/* Bootstrap 3 .hidden compatibility — BS5 removed this class */
.hidden { display: none !important; }

/* ── Global font size overrides for Bootstrap 3 components ── */
p, li, td, th, label, input, select, textarea, .form-control, .btn {
    font-size: 1rem;
}

.form-control {
    font-size: 1rem;
    height: auto;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.form-control:focus {
    border-color: #62487c;
    box-shadow: 0 0 0 3px rgba(98, 72, 124, 0.12);
    outline: none;
}

.table td, .table th {
    font-size: 1rem;
    padding: 10px 14px;
    vertical-align: middle;
}

/* Better card defaults */
.card {
    border: none !important;
    border-radius: 12px !important;
}

/* Wider content containers */
.container {
    max-width: 1200px;
}

/* Text muted override */
.text-muted {
    color: #888 !important;
}

/* Alert modernization */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 1rem;
}

/* Badge sizing */
.badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
}

/* ── Bootstrap 4 utility shims (Bootstrap 3 compatibility layer) ── */
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.flex-fill { flex: 1 1 auto !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.h-100 { height: 100% !important; }
.w-100 { width: 100% !important; }
.overflow-hidden { overflow: hidden !important; }
.rounded-lg { border-radius: 12px !important; }
.rounded { border-radius: 8px !important; }
.shadow-sm { box-shadow: 0 2px 8px rgba(0,0,0,0.07) !important; }
.shadow { box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important; }

/* Spacing utilities (Bootstrap 4 m/p shorthand) */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 40px !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 40px !important; }
.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 16px !important; }
.ml-2 { margin-left: 8px !important; }
.ml-3 { margin-left: 16px !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 16px !important; }
.p-4 { padding: 24px !important; }
.p-5 { padding: 40px !important; }
.px-3 { padding-left: 16px !important; padding-right: 16px !important; }
.px-4 { padding-left: 24px !important; padding-right: 24px !important; }
.py-3 { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-4 { padding-top: 24px !important; padding-bottom: 24px !important; }
.pt-3 { padding-top: 16px !important; }
.pt-4 { padding-top: 24px !important; }
.pb-3 { padding-bottom: 16px !important; }
.pb-4 { padding-bottom: 24px !important; }

/* Card component (Bootstrap 4 → 3 shim) */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    overflow: hidden;
}
.card-body {
    flex: 1 1 auto;
    padding: 20px;
}
.card-title {
    margin-bottom: 12px;
    font-weight: 700;
    color: #333;
    font-size: 1.05rem;
}
.card-text { margin-bottom: 0; }

/* Bootstrap 4 outline buttons */
.btn-outline-primary {
    color: #62487c;
    border: 2px solid #62487c;
    background: transparent;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: #62487c;
    color: white;
}
.btn-outline-secondary {
    color: #6c757d;
    border: 2px solid #6c757d;
    background: transparent;
}
.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
}
.btn-outline-warning {
    color: #e67e22;
    border: 2px solid #e67e22;
    background: transparent;
}
.btn-outline-warning:hover {
    background-color: #e67e22;
    color: white;
}

/* Bootstrap 4 contextual badge colors */
.badge-light { background-color: #f0ecf5; color: #62487c; }
.badge-secondary { background-color: #6c757d; color: white; }
.badge-success { background-color: #28a745; color: white; }
.badge-warning { background-color: #ffc107; color: #333; }
.badge-danger { background-color: #dc3545; color: white; }
.badge-info { background-color: #17a2b8; color: white; }
.badge-primary { background-color: #62487c; color: white; }

/* Bootstrap 4 text colors */
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-warning { color: #e67e22 !important; }
.text-info { color: #17a2b8 !important; }
.text-primary { color: #62487c !important; }
.text-white { color: #fff !important; }
.text-dark { color: #333 !important; }

/* Bootstrap 4 bg colors */
.bg-white { background-color: #fff !important; }
.bg-light { background-color: #f8f9fa !important; }
.bg-primary { background-color: #62487c !important; }

/* Bootstrap 4 border utilities */
.border { border: 1px solid #e0e0e0 !important; }
.border-0 { border: none !important; }
.border-top { border-top: 1px solid #e0e0e0 !important; }
.border-bottom { border-bottom: 1px solid #e0e0e0 !important; }

/* Bootstrap 4 font utilities */
.font-weight-bold { font-weight: 700 !important; }
.font-weight-500 { font-weight: 500 !important; }
.lead { font-size: 1.15rem; font-weight: 400; }
.small { font-size: 0.875rem !important; }

/* Bootstrap 4 justify-content-center for pagination */
.pagination.justify-content-center { justify-content: center; }

/* Gap utility */
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* img-fluid */
.img-fluid { max-width: 100%; height: auto; }

/* Bootstrap 4 blockquote */
.blockquote { font-size: 1.1rem; padding: 16px 20px; }

/* Bootstrap 4 custom-control */
.custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.5rem; }
.custom-control-input { position: absolute; z-index: -1; opacity: 0; }
.custom-control-label { position: relative; margin-bottom: 0; cursor: pointer; }
.custom-control-label::before {
    position: absolute;
    top: 2px;
    left: -1.5rem;
    display: block;
    width: 16px;
    height: 16px;
    content: '';
    background-color: #fff;
    border: 1px solid #adb5bd;
    border-radius: 3px;
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #62487c;
    border-color: #62487c;
}

/* input-group (Bootstrap 3 compatible) */
.input-group-prepend { display: flex; }
.input-group-text {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 1rem;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 8px 0 0 8px;
    white-space: nowrap;
    color: #555;
}
.input-group .form-control { border-radius: 0 8px 8px 0; }
.input-group { display: flex; align-items: stretch; width: 100%; }

/* Bootstrap 4 pagination shim */
.pagination { display: flex; list-style: none; padding: 0; margin: 0; }
.page-item { display: inline-block; }
.page-item.disabled .page-link { color: #ccc; pointer-events: none; }
.page-item.active .page-link { background-color: #62487c; border-color: #62487c; color: white; }
.page-link {
    display: block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #62487c;
    text-decoration: none;
    font-size: 0.95rem;
}
.page-link:hover { background-color: #f0ecf5; border-color: #62487c; color: #62487c; }

/* Bootstrap 4 offset columns */
.offset-md-3 { margin-left: 25%; }
.col-md-offset-3 { margin-left: 25%; }

/* Bootstrap 4 col-N (no breakpoint prefix) */
.col-12 { width: 100%; float: left; padding-left: 15px; padding-right: 15px; }
.col-6 { width: 50%; float: left; padding-left: 15px; padding-right: 15px; }
.col-4 { width: 33.333%; float: left; padding-left: 15px; padding-right: 15px; }
.col-3 { width: 25%; float: left; padding-left: 15px; padding-right: 15px; }

/* Bootstrap 4 form-label */
.form-label { display: block; margin-bottom: 4px; font-size: 0.9rem; font-weight: 500; color: #555; }
/* ── Mobile Viewport Improvements ── */
@media (max-width: 575px) {
    /* Reduce hero heading on XS phones */
    .hero-modern h1,
    .hero-modern .hero-title {
        font-size: 1.7rem !important;
        line-height: 1.3;
    }
    .hero-modern p {
        font-size: 0.95rem !important;
    }
    /* Tighter hero padding on mobile */
    .hero-modern,
    .hero-modern.hero-tall {
        padding: 30px 15px !important;
    }
    /* Full-width search on XS */
    .hero-search-wrapper {
        max-width: 100%;
        padding: 0 5px;
    }
    /* Tighter footer on mobile */
    footer {
        padding: 30px 0 20px;
    }
    footer .col-sm-3 {
        margin-bottom: 20px;
    }
    /* Prevent listing grid overflow */
    .listing-grid {
        grid-template-columns: 1fr !important;
    }
    /* Admin table: smaller font + padding for readability */
    .table td, .table th {
        font-size: 0.85rem;
        padding: 6px 8px;
    }
}
