/*
Theme Name: MitryVision
Theme URI: https://mitryvision.com/
Author: MitryVision
Author URI: https://mitryvision.com/
Description: Custom MitryVision theme providing a single post template and blog search results page styled to match the MitryVision brand. Uses Montserrat from Google Fonts and a #1A3D3D sidebar panel.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mitryvision
Tags: blog, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #2b2b2b;
    background: #ffffff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #1A3D3D;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover,
a:focus {
    color: #0f2828;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.mv-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.mv-site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mv-site-content {
    flex: 1 0 auto;
    padding: 48px 0 80px;
}

.mv-grid {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto 0;
    padding-top: 30px;
    padding-bottom: 60px;
    border-top: 1px solid #efefef;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 56px;
    align-items: start;
}

@media (max-width: 900px) {
    .mv-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* ==========================================================================
   Header (minimal — Elementor builder normally renders a header)
   ========================================================================== */
.mv-site-header {
    border-bottom: 1px solid #ececec;
    background: #ffffff;
}

.mv-site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 24px;
}

.mv-site-branding a {
    color: #1A3D3D;
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.02em;
}

.mv-site-branding img {
    max-height: 56px;
    width: auto;
}

.mv-primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

.mv-primary-nav a {
    color: #2b2b2b;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.02em;
}

.mv-primary-nav a:hover,
.mv-primary-nav .current-menu-item > a {
    color: #1A3D3D;
}

/* ==========================================================================
   Single post — article column
   ========================================================================== */
.mv-article {
    color: #2b2b2b;
}

.mv-article .mv-entry-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #3a2a26;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    margin: 0 0 24px;
    letter-spacing: -0.01em;
}

.mv-article .mv-entry-meta {
    color: #7a7a7a;
    font-size: 13px;
    margin-bottom: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mv-article .mv-featured-image {
    margin: 0 0 28px;
    border-radius: 6px;
    overflow: hidden;
}

.mv-article .mv-entry-content {
    font-size: 17px;
    line-height: 1.7;
}

.mv-article .mv-entry-content > *:first-child {
    margin-top: 0;
}

.mv-article .mv-entry-content p {
    margin: 0 0 1.2em;
}

.mv-article .mv-entry-content h2,
.mv-article .mv-entry-content h3,
.mv-article .mv-entry-content h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #2b2b2b;
    line-height: 1.25;
    margin: 1.6em 0 0.6em;
    letter-spacing: -0.005em;
}

.mv-article .mv-entry-content h2 { font-size: 1.7rem; }
.mv-article .mv-entry-content h3 { font-size: 1.35rem; }
.mv-article .mv-entry-content h4 { font-size: 1.15rem; }

.mv-article .mv-entry-content ul,
.mv-article .mv-entry-content ol {
    padding-left: 1.4em;
    margin: 0 0 1.2em;
}

.mv-article .mv-entry-content li {
    margin-bottom: 0.6em;
}

.mv-article .mv-entry-content li::marker {
    color: #1A3D3D;
}

.mv-article .mv-entry-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.25em;
    border-left: 4px solid #1A3D3D;
    background: #f7f7f4;
    color: #2b2b2b;
    font-style: italic;
}

.mv-article .mv-entry-content a {
    color: #1A3D3D;
    text-decoration: underline;
}

.mv-article .mv-entry-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #ececec;
    font-size: 14px;
    color: #6b6b6b;
}

/* ==========================================================================
   Sidebar (single post + search results) — dark panel
   ========================================================================== */
.mv-sidebar {
    background: #1A3D3D;
    color: #ffffff;
    border-radius: 6px;
    padding: 26px 28px 32px;
}

.mv-sidebar a {
    color: #ffffff;
}

.mv-sidebar .mv-breadcrumbs {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 22px;
    word-wrap: break-word;
}

.mv-sidebar .mv-breadcrumbs a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

.mv-sidebar .mv-breadcrumbs .sep {
    margin: 0 6px;
    opacity: 0.7;
}

.mv-sidebar .mv-widget-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #ffffff;
    margin: 28px 0 12px;
    line-height: 1.25;
}

.mv-sidebar .mv-widget-title:first-child,
.mv-sidebar .mv-breadcrumbs + .mv-widget,
.mv-sidebar > .mv-widget:first-child .mv-widget-title {
    margin-top: 0;
}

.mv-sidebar .mv-widget {
    margin-bottom: 26px;
}

.mv-sidebar .mv-widget:last-child {
    margin-bottom: 0;
}

.mv-sidebar p {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 15px;
    line-height: 1.55;
}

/* Search form */
.mv-search-form {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

.mv-search-form .mv-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: #1A3D3D;
}

.mv-search-form .mv-search-icon svg {
    width: 18px;
    height: 18px;
}

.mv-search-form input[type="search"] {
    flex: 1;
    border: 0;
    padding: 12px 12px 12px 0;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: #2b2b2b;
    background: transparent;
    outline: none;
    text-transform: uppercase;
}

.mv-search-form input[type="search"]::placeholder {
    color: #6b6b6b;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.mv-search-form button[type="submit"] {
    border: 0;
    background: transparent;
    color: transparent;
    width: 0;
    padding: 0;
    overflow: hidden;
}

/* Popular procedures list */
.mv-procedures-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mv-procedures-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 15px;
    line-height: 1.4;
}

.mv-procedures-list li:last-child {
    border-bottom: 0;
}

.mv-procedures-list li::before {
    content: "";
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='2.5,8.5 6.5,12.5 13.5,4.5'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
}

.mv-procedures-list a {
    color: #ffffff;
    text-decoration: none;
}

.mv-procedures-list a:hover {
    text-decoration: underline;
}

/* Archive list (monthly) */
.mv-archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mv-archive-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 15px;
    line-height: 1.4;
}

.mv-archive-list li:last-child {
    border-bottom: 0;
}

.mv-archive-list a {
    color: #ffffff;
    text-decoration: none;
}

.mv-archive-list a:hover,
.mv-archive-list a:focus {
    text-decoration: underline;
}

/* Sidebar button (e.g. View All) */
.mv-widget-viewall {
    text-align: left;
}

.mv-button {
    display: inline-block;
    padding: 12px 28px;
    background: #3AACBE;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-decoration: none;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.mv-button-viewall {
    display: block;
    width: 100%;
    text-align: left;
}

.mv-button:hover,
.mv-button:focus {
    background: #ffffff;
    color: #1A3D3D;
}

/* ==========================================================================
   Search results page — resource-centre-style listing
   ========================================================================== */
.mv-page-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 32px;
}

.mv-page-header .mv-page-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #3a2a26;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    line-height: 1.2;
    margin: 0 0 10px;
}

.mv-page-header .mv-page-subtitle {
    color: #6b6b6b;
    font-size: 15px;
    margin: 0;
}

.mv-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.mv-result-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mv-result-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.mv-result-card .mv-result-thumb {
    aspect-ratio: 16 / 10;
    background: #f1efe9;
    overflow: hidden;
}

.mv-result-card .mv-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mv-result-card .mv-result-body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.mv-result-card .mv-result-meta {
    color: #8a8a8a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mv-result-card .mv-result-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0;
    color: #2b2b2b;
}

.mv-result-card .mv-result-title a {
    color: inherit;
    text-decoration: none;
}

.mv-result-card .mv-result-title a:hover {
    color: #1A3D3D;
}

.mv-result-card .mv-result-excerpt {
    color: #5a5a5a;
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

.mv-result-card .mv-result-readmore {
    margin-top: auto;
    padding-top: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1A3D3D;
    text-decoration: none;
}

.mv-result-card .mv-result-readmore::after {
    content: " \2192";
}

.mv-no-results {
    background: #f7f7f4;
    border: 1px dashed #d8d8d2;
    border-radius: 6px;
    padding: 32px;
    text-align: center;
    color: #5a5a5a;
}

.mv-no-results .mv-search-form {
    max-width: 420px;
    margin: 18px auto 0;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.mv-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.mv-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mv-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d8d8d2;
    border-radius: 4px;
    color: #2b2b2b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.mv-pagination .page-numbers.current,
.mv-pagination .page-numbers:hover {
    background: #1A3D3D;
    color: #ffffff;
    border-color: #1A3D3D;
}

/* ==========================================================================
   Footer (minimal fallback)
   ========================================================================== */
.mv-site-footer {
    border-top: 1px solid #ececec;
    padding: 24px 0;
    color: #6b6b6b;
    font-size: 14px;
    text-align: center;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #ffffff;
    clip: auto !important;
    -webkit-clip-path: none;
    clip-path: none;
    color: #1A3D3D;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 12px 18px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

:focus-visible {
    outline: 2px solid #1A3D3D;
    outline-offset: 2px;
}

/* ==========================================================================
   Sticky site header — Elementor container with class .mitrySiteHeader
   ========================================================================== */

/*
 * The HFE/Elementor markup wraps the header in <header id="masthead"> and an
 * inner .elementor wrapper that are only as tall as the header itself.
 * position: sticky only works within the bounds of its nearest scrollable
 * ancestor, so we collapse those wrappers with display: contents to make the
 * sticky element a direct child of <body>. The top contact bar still scrolls
 * away normally; only .mitrySiteHeader sticks.
 */
#masthead,
#masthead > .elementor {
    display: contents;
}

.mitrySiteHeader {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Offset for the WordPress admin bar (logged-in users) */
.admin-bar .mitrySiteHeader {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .mitrySiteHeader {
        top: 46px;
    }
}

@media screen and (max-width: 600px) {
    .admin-bar .mitrySiteHeader {
        top: 0;
    }
}
