/* Single temple main card styling */
.tm-single-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    padding: 2.2rem 2rem 2rem 2rem;
    margin-bottom: 2.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 600px) {
    .tm-single-card {
        padding: 1.2rem 0.7rem 1.2rem 0.7rem;
    }
}

/* Services Offered section improvements */
.tm-temple-details h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #005177;
    margin-top: 2.2rem;

.tm-service-thumb img {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1/1;
    height: auto;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    background: #f8fafc;
    display: block;
}
    padding: 1.5rem 1.2rem 1.2rem 1.2rem;
    margin-bottom: 2rem;
}

/* Scoped CSS variables for theme adaptation (prefixed to avoid global overrides) */
:root {
    --tm-primary-color: #0073aa;
    --tm-primary-color-hover: #005177;
    --tm-background-color: #fff;
    --tm-text-color: #333;
    --tm-border-color: #ddd;
    --tm-border-radius: 6px;
    --tm-box-shadow-color: rgba(0, 0, 0, 0.06);
    --tm-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

.tm-photos-gallery a img {
    border-radius: 14px;
    box-shadow: 0 8px 15px var(--tm-box-shadow-color);
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4/3;
    height: auto;
    object-fit: cover;
    transition: transform 0.25s ease;
    background: #f8fafc;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.tm-photos-gallery a img:hover {
    transform: scale(1.05);
}
.tm-archive-wrapper .wrap,
.tm-single-wrapper .wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tm-temple-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: start;
    padding: 0.75rem 0 1.5rem 0;
}


.tm-temple-item {
    background: linear-gradient(135deg, #f8fafc 0%, #e3f0fa 100%);
    border: 1px solid #e0e7ef;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s cubic-bezier(.4,2,.3,1), box-shadow 0.22s;
    min-height: 260px;
    position: relative;
    overflow: hidden;
}
.tm-temple-item:hover {
    box-shadow: 0 18px 38px rgba(0,0,0,0.13);
    transform: translateY(-7px) scale(1.02);
    background: linear-gradient(135deg, #e3f0fa 0%, #f8fafc 100%);
}


.tm-temple-item img {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 1.1rem;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
}


.tm-temple-desc {
    font-size: 1.08rem;
    color: #3a3a3a;
    margin-bottom: 1.2rem;
    flex-grow: 1;
    line-height: 1.7;
    max-height: 7.5rem;
    overflow: hidden;
}


.tm-temple-taxonomies {
    font-size: 0.92rem;
    color: #0073aa;
    margin-bottom: 0.5rem;
}


.tm-temple-taxonomies a {
    color: #0073aa;
    text-decoration: none;
    margin-right: 0.5rem;
    font-weight: 500;
    border-bottom: 1px dotted #b3d4fc;
}
.tm-temple-taxonomies a:hover {
    text-decoration: underline;
    border-bottom: 1px solid #0073aa;
}


.tm-temple-details h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.1rem;
    color: #005177;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px #e3f0fa;
}

.tm-photos-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.tm-photos-gallery a img {
    border-radius: var(--tm-border-radius);
    box-shadow: 0 8px 15px var(--tm-box-shadow-color);
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.tm-photos-gallery a img:hover {
    transform: scale(1.05);
}

.tm-videos iframe {
    max-width: 100%;
    height: 280px;
    margin-bottom: 1.25rem;
    border-radius: var(--tm-border-radius);
    box-shadow: 0 8px 15px var(--tm-box-shadow-color);
}


.tm-services-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    align-items: start;
    margin-top: 1.5rem;
}

.tm-service-item {
    border: 1px solid #e0e7ef;
    border-radius: 16px;
    padding: 1.5rem 2rem 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e3f0fa 100%);
    box-shadow: 0 6px 24px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2.2rem;
    position: relative;
    transition: box-shadow 0.22s, transform 0.22s;
    min-height: 120px;
}
.tm-service-item:hover {
    box-shadow: 0 18px 38px rgba(0,0,0,0.13);
    transform: translateY(-5px) scale(1.01);
}

.tm-service-thumb {
    flex: 0 0 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    margin-right: 1.2rem;
}
.tm-service-thumb img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.tm-service-meta {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.tm-service-meta strong {
    font-size: 1.18rem;
    color: #005177;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.tm-service-price {
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #0073aa 0%, #005177 100%);
    padding: 0.22rem 0.7rem;
    border-radius: 14px;
    display: inline-block;
    font-size: 1.05rem;
    margin-top: 0.2rem;
    box-shadow: 0 2px 8px #e3f0fa;
}
.tm-service-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    margin-left: 2rem;
}
.tm-service-item .button {
    background: linear-gradient(90deg, #0073aa 0%, #005177 100%);
    border-radius: 8px;
    font-size: 1.02rem;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 2px 8px #e3f0fa;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-top: 0.2rem;
}
.tm-service-item .button:hover {
    background: linear-gradient(90deg, #005177 0%, #0073aa 100%);
    box-shadow: 0 4px 16px #b3d4fc;
}

@media (max-width: 700px) {
    .tm-service-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1.2rem;
        padding: 1.2rem 0.7rem 1.2rem 0.7rem;
    }
    .tm-service-thumb {
        margin-right: 0;
        margin-bottom: 0.7rem;
        height: 120px;
    }
    .tm-service-thumb img {
        width: 100%;
        height: 120px;
    }
    .tm-service-actions {
        margin-left: 0;
        margin-top: 1rem;
        align-items: stretch;
    }
}
.tm-service-item strong {
    font-size: 1.1rem;
    color: var(--tm-primary-color);
    font-weight: 700;
}
.tm-service-item p {
    color: var(--text-color);
    margin: 0;
}
.tm-service-item .button {
    background-color: var(--tm-primary-color);
    color: #fff;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: var(--tm-border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.98rem;
    align-self: flex-start;
    text-decoration: none;
    transition: background-color 0.25s ease;
}
.tm-service-item .button:hover {
    background-color: var(--tm-primary-color-hover);
}

/* Enhanced services grid and card layout */
.tm-services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    align-items: start;
}

.tm-service-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 1rem;
}


.tm-service-thumb img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}


.tm-service-meta {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}


.tm-service-meta strong {
    font-size: 1.18rem;
    display: block;
    color: #005177;
    font-weight: 700;
    margin-bottom: 0.2rem;
}


.tm-service-price {
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #0073aa 0%, #005177 100%);
    padding: 0.22rem 0.7rem;
    border-radius: 14px;
    display: inline-block;
    font-size: 1.05rem;
    margin-top: -0.2rem;
    box-shadow: 0 2px 8px #e3f0fa;
}


.tm-service-meta p {
    margin: 0;
    color: #444;
    font-size: 1.01rem;
}


.tm-service-item .button {
    margin-top: 0.7rem;
    align-self: start;
    background: linear-gradient(90deg, #0073aa 0%, #005177 100%);
    border-radius: 8px;
    font-size: 1.02rem;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 2px 8px #e3f0fa;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.tm-service-item .button:hover {
    background: linear-gradient(90deg, #005177 0%, #0073aa 100%);
    box-shadow: 0 4px 16px #b3d4fc;
}

/* Make sure long titles wrap nicely */
.tm-service-meta a { text-decoration: none; color: inherit; }


@media (max-width: 640px) {
    .tm-service-item { grid-template-columns: 1fr; }
    .tm-service-thumb img { width: 100%; height: 120px; }
    .tm-service-item { padding: 1rem; }
}

/* Mobile menu toggle styles */
.tm-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--tm-border-color);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 880px) {
    .tm-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
    .tm-main-nav { display: none; }
    .tm-mobile-toggle { display: inline-block; }
    .tm-main-nav.open { display: block; position: absolute; top: 64px; left: 0; right: 0; background: #fff; z-index: 9999; padding: 1rem; box-shadow: 0 8px 18px rgba(0,0,0,0.08); }
    .tm-main-nav.open .tm-nav { display: flex; flex-direction: column; gap: 0.5rem; }
}

/* Archive and single headings and nav */
.tm-archive-header {
    margin-bottom: 1rem;
}
.tm-inline-header { background: transparent; padding: 1rem 0; border-bottom: 1px solid transparent; }
.tm-header-inner { display: flex; align-items: center; gap: 1rem; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; box-sizing: border-box; }
.tm-site-branding { display: flex; align-items: center; flex: 0 0 auto; }
.tm-site-branding .custom-logo-link img { max-height: 64px; width: auto; display: block; }
.tm-site-title { font-size: 1.25rem; font-weight: 700; text-decoration: none; color: inherit; margin-left: 0.5rem; }
.tm-main-nav { margin-left: auto; display: flex; align-items: center; }
.tm-nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 1rem; align-items: center; }
.tm-nav li { margin: 0; }
.tm-nav a { text-decoration: none; color: inherit; padding: 0.25rem 0.5rem; }

@media (max-width: 880px) {
    .tm-header-inner { align-items: center; }
    .tm-main-nav.open { position: static; box-shadow: none; }
    .tm-nav { flex-direction: column; gap: 0.5rem; }
    .tm-site-branding .custom-logo-link img { max-height: 56px; }
}
.tm-archive-title {
    margin: 0 0 0.25rem 0;
    font-size: 2rem;
}
.tm-archive-intro {
    margin: 0 0 0.75rem 0;
    color: #6b6b6b;
}
.tm-single-nav {
    margin-bottom: 1rem;
}
.tm-single-nav a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
}
.tm-single-nav a:hover { border-bottom-color: var(--tm-border-color); }

/* Search form styling scoped to plugin */
.tm-temple-search {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}
.tm-temple-search .search-field {
    flex: 1 1 auto;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--tm-border-color);
    border-radius: 6px;
}
.tm-temple-search .tm-search-button {
    padding: 0.56rem 0.9rem;
    border: 1px solid var(--tm-primary-color);
    background: var(--tm-primary-color);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}
.tm-temple-search .tm-search-button:hover { background: var(--tm-primary-color-hover); }

/* Single content layout improvements */
.tm-single-main .tm-temple-details {
    max-width: 960px;
    margin: 0 auto;
    line-height: 1.75;
    font-size: 1.02rem;
    padding: 0 0.5rem;
}

/* Float only images that are meant to be inline with text (common WP classes) */
.tm-temple-details img.alignleft,
.tm-temple-details img.align-right,
.tm-temple-details img.alignleft,
.tm-temple-details img.alignright {
    max-width: 48%;
    height: auto;
    margin: 0 1.25rem 1rem 0;
    float: left;
    border-radius: 6px;
}

/* If a theme uses the newer block markup, target the block image wrapper */
.tm-temple-details .wp-block-image img,
.tm-temple-details figure img,
.tm-temple-details .tm-photos-gallery img {
    float: none !important;
    display: block;
    margin: 0 auto 1rem auto;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Constrain images inside the single content to a sensible width and height */
.tm-single-main .tm-temple-details img {
    max-width: 720px;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Ensure gallery thumbnails are consistent */
.tm-photos-gallery a img {
    max-height: 200px;
    width: 100%;
    object-fit: cover;
    display: block;
}

/* Full-width gallery override to be centered within constrained content */
.tm-photos-gallery {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-left: 0;
    margin-right: 0;
    gap: 1rem;
    align-items: start;
}

/* Caption styling for WP image captions and figures */
.tm-temple-details .wp-caption,
.tm-temple-details figure {
    margin: 0 0 1rem 0;
}
.tm-temple-details .wp-caption-text,
.tm-temple-details figcaption {
    font-size: 0.9rem;
    color: #6b6b6b;
    text-align: center;
    margin-top: 0.35rem;
}

/* Clear floats after content sections */
.tm-temple-details:after {
    content: "";
    display: table;
    clear: both;
}


@media (max-width: 768px) {
    .tm-temple-list {
        justify-content: center;
        gap: 1.2rem;
    }
    .tm-temple-item {
        width: 100%;
        max-width: 480px;
        padding: 1.2rem 0.7rem 1rem 0.7rem;
    }
}

@media (max-width: 480px) {
    .tm-photos-gallery {
        grid-template-columns: 1fr;
    }
    .tm-service-item {
        font-size: 0.95rem;
    }
}

/* Small utility spacing classes (opt-in in templates) */
.tm-mb-1 { margin-bottom: 0.5rem; }
.tm-mb-2 { margin-bottom: 1rem; }
.tm-mb-3 { margin-bottom: 1.5rem; }
