/*
Theme Name: Tamang Samaj
Theme URI: https://tamangsamajportugal.com
Author: Tamang Samaj Portugal
Description: A warm, modern block theme for Tamang community organisations. Himalaya and prayer-flag design, Nepali (Devanagari) and English typography, ready-made sections for events, Sonam Lhochhar, leadership, videos, gallery, timeline and contact.
Version: 1.4.2
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tamang-samaj
Tags: block-patterns, full-site-editing, one-column, custom-colors, custom-logo, editor-style, featured-images, translation-ready
*/

/* Prayer-flag stripe used under the header, above the footer and as a divider */
.ts-flags,
.wp-block-separator.is-style-prayer-flags {
	height: 8px;
	border: 0 !important;
	opacity: 1 !important;
	width: 100% !important;
	max-width: none !important;
	background: linear-gradient(90deg,
		#1f4fa8 0 20%, #ece6d8 20% 40%, #c8102e 40% 60%, #1f8a4c 60% 80%, #f2b51c 80% 100%) !important;
	background-size: 250px 100% !important;
	margin: 0;
}

/* Sticky header with soft shadow */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 18px rgba(16, 26, 60, .08); }
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }
/* Remove the gap WordPress puts between header, main and footer */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Cards */
.is-style-ts-card {
	background: var(--wp--preset--color--base);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(16, 26, 60, .08);
	transition: transform .25s ease, box-shadow .25s ease;
	overflow: hidden;
}
.is-style-ts-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(16, 26, 60, .14); }

/* Round member photos */
.ts-member img { aspect-ratio: 1; object-fit: cover; object-position: 50% 25%; border-radius: 50%; border: 4px solid var(--wp--preset--color--gold); }

/* Timeline */
.ts-timeline { position: relative; }
.ts-timeline::before { content: ""; position: absolute; left: 22px; top: 6px; bottom: 6px; width: 4px; border-radius: 4px;
	background: linear-gradient(var(--wp--preset--color--primary), var(--wp--preset--color--accent)); }
.ts-timeline > .wp-block-group { position: relative; padding-left: 64px; }
.ts-timeline > .wp-block-group::before { content: ""; position: absolute; left: 12px; top: 8px; width: 24px; height: 24px; border-radius: 50%;
	background: var(--wp--preset--color--gold); border: 4px solid var(--wp--preset--color--base); box-shadow: 0 0 0 3px var(--wp--preset--color--primary); }

/* Hero mountains sit at the bottom of the cover */
.ts-hero { position: relative; overflow: hidden; }
.ts-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 120px; pointer-events: none;
	background: url("assets/images/mountains.svg") bottom center / 100% 100% no-repeat; }
.ts-hero .wp-block-cover__inner-container { position: relative; z-index: 2; }

/* Embeds and maps round corners */
.wp-block-embed iframe, .ts-map iframe { border-radius: 16px; }
.ts-map iframe { width: 100%; min-height: 380px; border: 0; display: block; }

/* Buttons lift a little on hover */
.wp-block-button__link { transition: transform .2s ease, box-shadow .2s ease; }
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 26, 60, .18); }

/* Gallery images rounded */
.wp-block-gallery.is-style-ts-rounded img { border-radius: 14px; }

/* Small pill above the big title */
.ts-kicker { width: fit-content; margin-left: auto !important; margin-right: auto !important; }

/* Logo size */
.ts-logo { margin: 0; }
.ts-logo img { width: 360px !important; max-width: 62vw; height: auto; }
@media (max-width: 600px) { .ts-logo img { width: 230px !important; } }

/* ---------- Typography polish (v1.1) ---------- */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, .wp-block-post-title { text-wrap: balance; }
p, li { text-wrap: pretty; }
::selection { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--primary-dark); }

/* Nicer links: thin underline that thickens on hover */
a { text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: color .2s ease, text-decoration-color .2s ease; }
a:hover { text-decoration-thickness: 2px; }

/* Small label above each section title */
.ts-eyebrow {
	display: flex; align-items: center; gap: .7rem; width: fit-content;
	font-size: .9rem !important; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: -.6rem !important;
}
.ts-eyebrow.has-text-align-center { margin-left: auto !important; margin-right: auto !important; }
.ts-eyebrow::before, .ts-eyebrow::after { content: ""; width: 28px; height: 2px; border-radius: 2px; background: currentColor; opacity: .55; }
.ts-eyebrow:not(.has-text-align-center)::after { display: none; }

/* Prayer-flag mark under centred section titles */
h2.wp-block-heading.has-text-align-center::after {
	content: ""; display: block; width: 110px; height: 5px; margin: .9rem auto 0; border-radius: 4px;
	background: linear-gradient(90deg, #1f4fa8 0 20%, #ece6d8 20% 40%, #c8102e 40% 60%, #1f8a4c 60% 80%, #f2b51c 80% 100%);
}

/* Hero title */
.ts-hero h1 { font-size: clamp(2.8rem, 7vw, 5.4rem) !important; text-shadow: 0 4px 30px rgba(5, 14, 40, .45); }
.ts-hero h1 + p { font-family: var(--wp--preset--font-family--serif); font-weight: 500; opacity: .95; }

/* Big numbers use the heading font */
.ts-stat { font-family: var(--wp--preset--font-family--serif); font-weight: 800 !important; letter-spacing: -.02em; }

/* Cards: hairline border and softer, layered shadow */
.is-style-ts-card {
	border: 1px solid rgba(16, 26, 60, .06);
	box-shadow: 0 1px 2px rgba(16, 26, 60, .05), 0 12px 32px -8px rgba(16, 26, 60, .12);
}
.is-style-ts-card:hover { box-shadow: 0 2px 4px rgba(16, 26, 60, .06), 0 24px 48px -12px rgba(16, 26, 60, .22); }
.is-style-ts-card h3 { line-height: 1.35; }

/* Member photos get a soft halo */
.ts-member img { box-shadow: 0 0 0 6px rgba(242, 181, 28, .18); transition: transform .3s ease; }
.ts-member:hover img { transform: scale(1.04); }

/* Images zoom slightly inside rounded frames */
.wp-block-gallery.is-style-ts-rounded figure { overflow: hidden; border-radius: 14px; }
.wp-block-gallery.is-style-ts-rounded img { transition: transform .5s ease; }
.wp-block-gallery.is-style-ts-rounded figure:hover img { transform: scale(1.05); }

/* Navigation: animated underline */
.wp-block-navigation .wp-block-navigation-item__content { position: relative; padding-block: .3rem; }
.wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
	background: var(--wp--preset--color--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.wp-block-navigation-item:hover > .wp-block-navigation-item__content::after,
.wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }
.wp-block-navigation .wp-block-navigation__submenu-container { border: 0 !important; border-radius: 12px; padding: .5rem 0; box-shadow: 0 18px 40px rgba(16, 26, 60, .16); }
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: .45rem 1.1rem; }

/* Long-form pages read better */
.wp-block-post-content p, .wp-block-post-content li { max-width: 70ch; }
.wp-block-post-content h2 { margin-top: 2.4em; }

/* Footer typography */
footer .wp-block-heading { font-family: var(--wp--preset--font-family--mukta); letter-spacing: .08em; }
.ts-footer-links { list-style: none; padding-left: 0; line-height: 2; }
.ts-footer-links a { text-decoration: none; opacity: .9; }
.ts-footer-links a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Introduction page (v1.2) ---------- */
.ts-page-hero::after { height: 90px; }
.ts-lead { font-family: var(--wp--preset--font-family--serif); font-size: clamp(1.2rem, 2vw, 1.45rem) !important; line-height: 1.85; color: var(--wp--preset--color--contrast); }
.ts-prose { font-size: 1.15rem; line-height: 1.95; }
.ts-logo-card .wp-block-image img { border-radius: 0; }
.ts-heritage { position: relative; }
.ts-num { font-family: var(--wp--preset--font-family--serif); font-size: 2.6rem !important; font-weight: 800; line-height: 1 !important;
	color: var(--wp--preset--color--gold); opacity: .9; }
.ts-heritage h3 { margin-top: .4rem !important; font-size: 1.7rem !important; }
.ts-focus { border-radius: 14px; border: 1px solid rgba(16, 26, 60, .07); align-items: center; transition: transform .2s ease, background-color .2s ease; }
.ts-focus:hover { transform: translateY(-3px); background: #fff3d6 !important; }
.ts-focus p { margin: 0 !important; }
.ts-photo-frame img { border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55); outline: 6px solid rgba(255, 255, 255, .12); outline-offset: 8px; }
.ts-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.ts-facts li { position: relative; padding: .55rem .9rem .55rem 2.4rem; border-radius: 10px; background: rgba(255, 255, 255, .08); line-height: 1.5; }
.ts-facts li::before { content: ""; position: absolute; left: .9rem; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--wp--preset--color--gold); }
.ts-facts strong { color: var(--wp--preset--color--gold); font-weight: 600; }

/* ---------- Founding members page (v1.3) ---------- */
.ts-date-pills p { margin: 0 !important; padding: .35rem 1rem; border-radius: 999px; font-size: .95rem; font-weight: 600;
	background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); color: #fff; }
.ts-founder img { width: 150px !important; }
.ts-initial { display: grid; place-items: center; width: 150px; height: 150px; margin: 0 auto !important; border-radius: 50%;
	font-family: var(--wp--preset--font-family--serif); font-size: 3.4rem !important; font-weight: 700; line-height: 1 !important; color: #fff;
	background: linear-gradient(145deg, var(--wp--preset--color--primary), var(--wp--preset--color--primary-dark));
	border: 4px solid var(--wp--preset--color--gold); box-shadow: 0 0 0 6px rgba(242, 181, 28, .18); }
.ts-initial-sm { width: 78px; height: 78px; font-size: 1.9rem !important; border-width: 3px; box-shadow: none; }
.ts-role { display: inline-block; margin-left: auto !important; margin-right: auto !important; padding: .1rem .8rem; border-radius: 999px;
	font-size: .9rem !important; font-weight: 600; color: var(--wp--preset--color--accent); background: rgba(200, 16, 46, .08); }
.ts-member-chip { border-radius: 16px; border: 1px solid rgba(16, 26, 60, .07); text-align: center; transition: transform .2s ease, box-shadow .2s ease; }
.ts-member-chip:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -12px rgba(16, 26, 60, .25); }
.ts-member-chip p { margin: 0 !important; }
.ts-quote-mark { font-family: var(--wp--preset--font-family--serif); font-size: 5rem !important; line-height: .6 !important; margin-bottom: 0 !important; }
@media (max-width: 600px) {
	.ts-eyebrow { letter-spacing: .1em; }
	.ts-eyebrow::before, .ts-eyebrow::after { display: none; }
}

/* ---------- v1.3.1 fixes ---------- */
.has-night-sky-gradient-background .ts-eyebrow:not(.has-text-color),
.has-lhochhar-gradient-background .ts-eyebrow:not(.has-text-color) { color: var(--wp--preset--color--gold); }
.ts-initial-md { width: 130px; height: 130px; font-size: 2.9rem !important; }
.wp-block-gallery.is-style-ts-rounded img { cursor: zoom-in; }
/* Whole number card clickable */
.ts-stat-link { position: relative; cursor: pointer; }
.ts-stat-link a { color: inherit; text-decoration: none; }
.ts-stat-link a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ts-stat-link:hover { box-shadow: 0 0 0 2px var(--wp--preset--color--gold), 0 24px 48px -12px rgba(16, 26, 60, .22); }

/* ---------- v1.4 site-wide content fixes ---------- */
/* Show a friendly note when a page has no content yet */
.ts-empty-note { display: none !important; border-radius: 18px; box-shadow: 0 12px 32px -8px rgba(16, 26, 60, .12); }
.wp-block-group:not(:has(> .wp-block-post-content)) > .ts-empty-note,
.wp-block-post-content:not(:has(*)) + .ts-empty-note { display: block !important; }

/* Colours used in old page content (WordPress default palette) */
.has-vivid-red-color { color: #cf2e2e !important; }
.has-luminous-vivid-orange-color { color: #ff6900 !important; }
.has-vivid-red-background-color { background-color: #cf2e2e !important; }
.has-luminous-vivid-orange-background-color { background-color: #ff6900 !important; }

/* Tables (member details, committee lists) */
.wp-block-post-content .wp-block-table { overflow-x: auto; }
.wp-block-post-content .wp-block-table table { border-collapse: separate; border-spacing: 0; width: 100%; background: #fff;
	border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(16, 26, 60, .05), 0 10px 28px -10px rgba(16, 26, 60, .14); }
.wp-block-post-content .wp-block-table td, .wp-block-post-content .wp-block-table th { border: 0; border-bottom: 1px solid rgba(16, 26, 60, .08); padding: .7rem 1rem; vertical-align: top; }
.wp-block-post-content .wp-block-table tr:last-child td { border-bottom: 0; }
.wp-block-post-content .wp-block-table tr:nth-child(even) td { background: var(--wp--preset--color--cream); }
.wp-block-post-content .wp-block-table thead th { background: var(--wp--preset--color--primary-dark); color: #fff; text-align: left; }

/* Contact Form 7 */
.wpcf7 form { display: grid; gap: .9rem; }
.wpcf7 label { display: block; font-weight: 600; color: var(--wp--preset--color--primary-dark); }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea, .wpcf7 select {
	width: 100%; margin-top: .35rem; padding: .75rem 1rem; font: inherit; color: inherit; background: #fff;
	border: 1.5px solid rgba(16, 26, 60, .15); border-radius: 12px; transition: border-color .2s ease, box-shadow .2s ease; }
.wpcf7 input:focus, .wpcf7 textarea:focus, .wpcf7 select:focus { outline: 0; border-color: var(--wp--preset--color--primary); box-shadow: 0 0 0 4px rgba(31, 79, 168, .15); }
.wpcf7 textarea { min-height: 150px; }
.wpcf7 input[type="submit"] { justify-self: start; padding: .8rem 2rem; font: inherit; font-weight: 600; color: #fff; cursor: pointer;
	background: var(--wp--preset--color--accent); border: 0; border-radius: 999px; transition: transform .2s ease, background-color .2s ease; }
.wpcf7 input[type="submit"]:hover { background: #8e0b22; transform: translateY(-2px); }
.wpcf7 .wpcf7-response-output { border-radius: 12px; margin: 0 !important; }

/* Content images, videos and galleries never overflow and stay sharp */
.wp-block-post-content img { max-width: 100%; height: auto; }
.wp-block-post-content .wp-block-video video { border-radius: 16px; width: 100%; }
.wp-block-post-content .wp-block-gallery img { border-radius: 12px; }
.wp-block-post-content .wp-block-separator:not(.is-style-prayer-flags) { border: 0; border-top: 2px solid rgba(16, 26, 60, .1); opacity: 1; }

/* Hub cards */
.ts-hub-card h3 a { text-decoration: none; color: var(--wp--preset--color--primary-dark); }
.ts-video-frame { margin-top: var(--wp--preset--spacing--40) !important; }
.ts-video-frame video { width: 100%; border-radius: 18px; background: #000; box-shadow: 0 30px 60px -24px rgba(16, 26, 60, .45); }

/* Old page content pulled photos up over the name with a negative margin – undo it */
.wp-block-post-content [style*="margin-top:-"] { margin-top: .6rem !important; }
.wp-block-post-content [style*="margin-bottom:-"] { margin-bottom: .6rem !important; }
