/*
 * Tamilmanam The7 Child – the journal details on top of The7.
 *
 * The7 draws the header, menu, footer and bottom bar from its Theme Options
 * (colours, fonts, sizes). This file adds what The7 has no option for: the
 * bilingual masthead, Tamil + English labels, the language switch and Submit
 * button, the gold rules, the footer columns, the licence line, and the
 * Journal Kit's design tokens.
 *
 * The values are defaults; inc/design.php prints the site's values on body
 * (from The7 → Theme Options → Tamilmanam and The7's own options).
 */

:root {
	--ay-ink: #14365d;
	--ay-ink-2: #0f2747;
	--ay-saffron: #1d5fa8;
	--ay-saffron-dark: #174c86;
	--ay-gold: #c9a227;
	--ay-gold-soft: #ebd9a0;
	--ay-leaf: #2e7d6b;
	--ay-cream: #f4f6f9;
	--ay-sand: #e9edf3;
	--ay-peach: #eef3fa;
	--ay-line: #d9dfe8;
	--ay-text: #1e2430;
	--ay-muted: #5b6474;
	--ay-mist: #d9e2ef;
	--ay-white: #fff;
	--ay-serif: "Manam Serif", "Noto Serif", Georgia, "Times New Roman", serif;
	--ay-sans: "Manam Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--ay-radius: 10px;
	--ay-radius-card: 12px;
	--ay-btn-radius: 8px;
	--ay-shadow: 0 10px 30px -12px rgba(15, 39, 71, .25);
	--ay-wrap: 1200px;
	--ay-gutter: 20px;
	--ay-gutter-m: 16px;
	--ay-fs: 17px;
	--ay-fs-m: 16px;
	--ay-lh: 1.65;
	--ay-lh-ta: 1.8;
	--ay-hw: 700;
	--ay-hlh: 1.25;
	--ay-p-space: 14px;
	--ay-logo-h: 70px;
	--ay-logo-h-m: 52px;
	--ay-menu-fs: 15px;
}

body.tamilmanam { --ay-gut: var(--ay-gutter); --ay-fs-now: var(--ay-fs); }
@media (max-width: 767px) {
	body.tamilmanam {
		--ay-gut: var(--ay-gutter-m);
		--ay-fs-now: var(--ay-fs-m);
		/* The7's text size follows "Text size on phones". */
		--the7-base-font-size: var(--ay-fs-m);
		--the7-text-big-font-size: calc(var(--ay-fs-m) + 1px);
	}
}

/* ---------- Base ---------- */

html { scroll-padding-top: 90px; }
body.tamilmanam { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.tamilmanam :lang(ta) { line-height: var(--ay-lh-ta); }
.tamilmanam :is(h1, h2) :lang(ta) { line-height: 1.45; }
.tamilmanam :is(h3, h4, h5, h6) :lang(ta) { line-height: 1.55; }
.tamilmanam ::selection { background: var(--ay-gold-soft); color: var(--ay-ink); }
.tamilmanam :focus-visible { outline: 3px solid var(--ay-gold); outline-offset: 2px; border-radius: 3px; }
:where(.tamilmanam #content) p { margin-block: 0 var(--ay-p-space); }

/* Elementor: headings keep a readable line height; boxed sections follow
   The7's content width; buttons follow The7's button corners. A value set on
   one widget or section in Elementor still wins. */
body.tamilmanam .elementor-widget-heading .elementor-heading-title { line-height: var(--ay-hlh); }
body.tamilmanam .elementor-section-boxed > .elementor-container { max-width: var(--ay-wrap); }
body.tamilmanam .elementor-button { border-radius: var(--ay-btn-radius); }

/* ---------- English / Tamil ----------
 * Text comes in pairs, Tamil first: span.l-ta.l-1 + span.l-en.l-2 (div.l-block
 * for paragraphs). The Tamilmanam Language add-on sets html[data-tmk-lang] to
 * "ta", "both" or "en" and hides the other language. With both – or without
 * the add-on – the English line sits under the Tamil one.
 *   .l-compact  no room for two lines: Tamil only when both are shown
 *   .l-both     shown only when both languages are
 */
.l-ta, [lang="ta"] { letter-spacing: normal; text-transform: none; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) :where(.l-2:not(.l-block)) { display: block; font-size: .86em; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) :where(.l-2.l-block) { margin-top: .5em; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) :is(.l-compact, .tm7-brand__title, .tm7-brand__sub, .tm7-f-name, .tm7-f-sub, .top-bar .mini-nav, .bottom-text-block) .l-2 { display: none !important; }

/* ---------- Top bar ---------- */

.masthead .top-bar { font-family: var(--ay-sans); }
.top-bar .mini-widgets { align-items: center; }
.top-bar .text-area p { margin: 0; }
.tm7-ids { display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; }
.tm7-ids strong { color: var(--ay-white); font-weight: 700; letter-spacing: .02em; }
.tm7-badges { color: var(--ay-gold); font-weight: 600; }
.top-bar .mini-nav ul { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.top-bar .mini-nav li { margin: 0 !important; padding: 0 !important; }
.top-bar .mini-nav li::before, .top-bar .mini-nav li::after { display: none !important; }
.top-bar .mini-nav li > a { color: var(--ay-mist); }
.top-bar .mini-nav li > a:hover .menu-text { color: var(--ay-white); text-decoration: underline; }
.top-bar .mini-nav .menu-select { display: none; }
.top-bar .mini-widgets { gap: 2px 1.4rem; }
.top-bar .mini-widgets > * { margin: 0 !important; }
.top-bar .left-widgets { flex: 1 1 0%; min-width: 0; }
.top-bar .right-widgets { flex: 0 0 auto; max-width: 50%; text-align: right; }

/* ---------- Masthead ---------- */

body.tamilmanam .masthead .branding > a.tm7-brand {
	display: flex !important;
	align-items: center;
	gap: .9rem;
	min-width: 0;
	text-decoration: none;
	font-size: 1rem;
	line-height: 1.2;
}
.tm7-brand__mark, .tm7-brand__logo { flex: 0 0 auto; line-height: 0; }
.tm7-brand__mark svg { width: calc(var(--ay-logo-h) * .8); height: auto; max-width: 96px; }
.tm7-brand__logo img { max-height: var(--ay-logo-h); width: auto !important; height: auto; }
.tm7-brand__text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.tm7-brand__title {
	font-family: var(--ay-serif);
	font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: .01em;
	color: var(--ay-ink);
}
.tm7-brand__sub {
	font-family: var(--ay-sans);
	font-size: .82rem;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: var(--ay-muted);
	font-weight: 600;
	margin-top: .25rem;
	line-height: 1.35;
}
.tm7-brand__sub [lang="ta"] { text-transform: none; letter-spacing: 0; font-size: .95rem; }
.tm7-brand__en { font-family: var(--ay-sans); font-size: .88rem; color: var(--ay-saffron); font-weight: 600; margin-top: .2rem; line-height: 1.35; }
.tm7-brand--logo-only .tm7-brand__logo img { max-height: var(--ay-logo-h); }

/* Language switch and Submit button next to the masthead */
.classic-header .branding .mini-widgets { gap: .75rem; }
.branding .mini-widgets .text-area { margin: 0 !important; }
.branding .mini-widgets .text-area p { margin: 0; }
.tm7-lang .tml-inline { display: flex; }
.tm7-lang .tml-switch__opt, .tm7-lang .tml-switch__opt:hover { text-decoration: none !important; }
.tm7-cta {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: .65rem 1.35rem;
	min-height: 48px;
	border-radius: var(--ay-btn-radius);
	background: var(--ay-saffron);
	color: var(--ay-white) !important;
	font-family: var(--ay-sans);
	font-weight: 700;
	font-size: .95rem;
	line-height: 1.25;
	text-decoration: none !important;
	text-align: center;
	transition: background-color .2s;
	box-sizing: border-box;
}
.tm7-cta:hover, .tm7-cta:focus { background: var(--ay-saffron-dark); color: var(--ay-white) !important; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .tm7-cta .l-2 { font-size: .78rem; font-weight: 600; opacity: .92; }

/* ---------- Main menu (brand-colour bar with a gold rule) ---------- */

.classic-header.bg-behind-menu .navigation::before { box-shadow: inset 0 3px 0 var(--ay-gold); }
.classic-header .navigation { padding-top: 3px; }
/* Same bar height in every language mode (two lines when both are shown). */
.classic-header .main-nav > li > a { min-height: calc(var(--ay-menu-fs) * 2.6 + 22px); box-sizing: border-box; display: flex; align-items: center; }
.main-nav > li > a .menu-text { display: flex; flex-direction: column; align-items: flex-start; }
.main-nav > li > a .menu-ta, .main-nav > li > a .menu-en { font-size: var(--ay-menu-fs); }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .main-nav > li > a .l-2 {
	font-size: .74rem;
	font-weight: 400;
	color: var(--ay-gold-soft);
	line-height: 1.4;
	margin-top: 1px;
}
.main-nav > li > a:hover, .main-nav > li > a:focus { background: rgba(255, 255, 255, .06); }
.main-nav > li.has-children > a .menu-text { padding-right: 2px; }
/* Dropdowns */
.main-nav .sub-nav {
	border-top: 3px solid var(--ay-saffron);
	border-radius: 0 0 var(--ay-radius) var(--ay-radius);
	box-shadow: var(--ay-shadow);
}
.main-nav .sub-nav .menu-text { display: block; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .main-nav .sub-nav .l-2 { font-size: .82em; color: var(--ay-saffron); font-weight: 500; }
.main-nav .sub-nav > li > a:hover .menu-text { color: var(--ay-ink); }

/* Sticky header: only the menu bar stays (as in the Tamilmanam design). */
.masthead.sticky-on .header-bar > .branding { display: none !important; }
.masthead.sticky-on .header-bar { min-height: 0 !important; height: auto !important; }
.masthead.sticky-on .main-nav > li > a { padding-top: 6px; padding-bottom: 6px; }

/* ---------- Mobile header and menu (tablets and phones) ---------- */

body.tamilmanam .mobile-header-bar .mobile-branding > a.tm7-brand { display: flex !important; align-items: center; gap: .6rem; text-decoration: none; line-height: 1.2; font-size: 1rem; }
.mobile-header-bar .tm7-brand__mark svg { width: calc(var(--ay-logo-h-m) * .8); }
.mobile-header-bar .tm7-brand__logo img { max-height: var(--ay-logo-h-m); }
.mobile-header-bar .tm7-brand__title { font-size: 1.4rem; }
.mobile-header-bar .tm7-brand__sub { font-size: .66rem; letter-spacing: .06em; }
.mobile-header-bar .tm7-brand__en { display: none; }
.dt-mobile-header .mobile-main-nav .menu-text .l-2 { font-size: .78em; font-weight: 400; color: var(--ay-gold-soft); }
.dt-mobile-header .mobile-mini-widgets-in-menu .tm7-cta { width: 100%; margin-top: .5rem; }
.dt-mobile-header .mobile-mini-widgets-in-menu .mini-nav ul { display: flex; flex-direction: column; gap: .4rem; }
.dt-mobile-header .mobile-mini-widgets-in-menu .mini-nav a { color: var(--ay-mist); }
/* The switch in the dark top bar */
.top-bar .tml-switch--masthead { color: var(--ay-mist); background: rgba(255, 255, 255, .06); border-color: color-mix(in srgb, var(--ay-gold) 50%, transparent); }
.top-bar .tml-switch--masthead .tml-switch__opt { min-height: 30px; padding: .25rem .7rem; }
.top-bar .tml-switch--masthead .tml-switch__opt:hover { background: rgba(255, 255, 255, .14); }
.top-bar .tml-switch--masthead .tml-switch__opt.is-active,
.top-bar .tml-switch--masthead .tml-switch__opt[aria-current="true"] { background: var(--ay-gold); color: var(--ay-ink); }

@media (max-width: 1100px) {
	.top-bar .mini-widgets { justify-content: center; }
}
@media (max-width: 778px) {
	.mobile-header-bar .tm7-brand__title { font-size: 1.25rem; }
	.mobile-header-bar .tm7-brand__sub { font-size: .6rem; }
	.top-bar .tm7-ids { justify-content: center; font-size: .78rem; }
}

/* ---------- Footer (widget columns) ---------- */

#footer { border-top: 4px solid var(--ay-gold); font-family: var(--ay-sans); }
#footer .widget-title {
	font-family: var(--ay-serif);
	color: var(--ay-white);
	font-size: 1.1rem;
	line-height: 1.45;
	margin-bottom: .9rem;
}
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) #footer .widget-title .l-2 {
	font-family: var(--ay-sans);
	font-size: .78rem;
	color: var(--ay-gold-soft);
	font-weight: 600;
	margin-top: .15rem;
	line-height: 1.5;
}
#footer a { color: var(--ay-white); text-decoration: none; }
#footer a:hover, #footer a:focus { color: var(--ay-gold); text-decoration: underline; }
#footer .widget_nav_menu ul { list-style: none; margin: 0; padding: 0; }
#footer .widget_nav_menu li { margin: 0 0 .45rem; padding: 0; border: 0; }
#footer .widget_nav_menu li::before { display: none; }
#footer .widget_nav_menu li a { display: block; line-height: 1.45; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) #footer .widget_nav_menu .l-2 { font-size: .8em; opacity: .72; line-height: 1.5; }
.tm7-f-about p { margin: 0; }
.tm7-f-name { font-family: var(--ay-serif); font-size: 1.6rem; font-weight: 700; color: var(--ay-white); line-height: 1.3; }
.tm7-f-sub { color: var(--ay-white); font-weight: 600; margin-top: .15rem !important; }
.tm7-f-en { color: var(--ay-gold-soft); font-size: .88rem; margin: .2rem 0 .8rem !important; }
.tm7-f-ids { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0 0 .9rem !important; }
.tm7-f-ids strong { color: var(--ay-white); }
.tm7-f-about .l-block p { margin: 0 0 .6rem; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .tm7-f-about .l-2.l-block { color: var(--ay-gold-soft); font-size: .92em; background: none; border-radius: 0; border-left: 2px solid var(--ay-gold); padding: 0 0 0 .8rem; margin: .2rem 0 .8rem; }
.tm7-f-contact address { font-style: normal; margin: 0 0 .9rem; line-height: 1.6; }
.tm7-f-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.tm7-f-list li { margin: 0; padding: 0; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .tm7-f-list .l-2 { font-size: .8em; opacity: .72; }

/* Column widths like the journal's footer: wider first and last columns. */
@media (min-width: 1101px) {
	#footer .wf-container > .widget:nth-child(4n+1) { width: 31%; }
	#footer .wf-container > .widget:nth-child(4n+2),
	#footer .wf-container > .widget:nth-child(4n+3) { width: 22%; }
	#footer .wf-container > .widget:nth-child(4n+4) { width: 25%; }
}

/* Tablets: two columns; phones: one (The7 stacks them). */
@media (min-width: 779px) and (max-width: 1100px) {
	#footer .wf-container { display: flex; flex-wrap: wrap; }
	#footer .wf-container > .widget { width: 50% !important; }
}

/* ---------- Bottom bar: licence, copyright, bottom links ---------- */

#bottom-bar { font-family: var(--ay-sans); font-size: .82rem; }
.tm7-bottom { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; padding-block: .5rem; text-align: left; }
@media (max-width: 1100px) {
	.tm7-bottom { align-items: center; text-align: center; }
	.tm7-licence { flex-direction: column; }
}
.tm7-licence { display: flex; align-items: center; gap: .75rem; max-width: 640px; line-height: 1.5; }
.tm7-cc { flex: 0 0 auto; line-height: 0; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .tm7-licence .l-2 { margin-top: .2rem; opacity: .8; font-size: .9em; }
#bottom-bar a { color: var(--ay-mist); }
#bottom-bar a:hover { color: var(--ay-white); }
#bottom-bar .mini-nav .menu-text { display: block; }
#bottom-bar .menu-select { display: none !important; }
/* The bottom links stay a list on phones (The7 would turn them into a select). */
@media (max-width: 778px) {
	#bottom-bar .mini-nav > ul { display: flex !important; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; padding-bottom: .5rem; }
	#bottom-bar .mini-nav > ul > li { margin: 0 !important; }
}

/* ---------- Breadcrumbs under the menu (Journal Kit pages) ---------- */

.tm7-crumbs-bar { background: var(--ay-cream); border-bottom: 1px solid var(--ay-line); font-family: var(--ay-sans); font-size: .85rem; }
.tm7-crumbs-wrap { max-width: var(--ay-wrap); margin-inline: auto; padding-inline: var(--ay-gut); box-sizing: border-box; }
.tm7-crumbs ol, .tm7-crumbs-bar .rank-math-breadcrumb p { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: .55rem 0; gap: .2rem; line-height: 1.5; }
.tm7-crumbs li { display: inline-flex; align-items: center; color: var(--ay-muted); margin: 0; padding: 0; }
.tm7-crumbs li::before { display: none; }
.tm7-crumbs li + li::before { content: "›"; display: inline; margin: 0 .45rem; color: var(--ay-saffron); position: static; background: none; width: auto; height: auto; }
.tm7-crumbs a { color: var(--ay-ink); text-decoration: none; }
.tm7-crumbs a:hover { text-decoration: underline; }

/* ---------- Page titles (posts, archives) and plain content ---------- */

.page-title .breadcrumbs a { color: var(--ay-ink); }
.page-title h1 :lang(ta) { line-height: 1.45; }
.tamilmanam #content table:not(.tmk-fees) { border-collapse: collapse; width: 100%; margin: 1.25rem 0; }
.tamilmanam #content :is(th, td) { border: 1px solid var(--ay-line); padding: .6rem .8rem; vertical-align: top; }
.tamilmanam #content thead th { background: var(--ay-cream); color: var(--ay-ink); }
.tamilmanam #content blockquote { border-left: 4px solid var(--ay-gold); background: var(--ay-cream); padding: 1rem 1.25rem; font-family: var(--ay-serif); }
.tamilmanam #content :is(input, select, textarea):focus { border-color: var(--ay-saffron); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ay-saffron) 18%, transparent); outline: none; }

/* Page not found */
.tm7-notfound { max-width: 820px; margin-inline: auto; padding-block: 1rem 3rem; }
.tm7-notfound .searchform { margin: 1.25rem 0; }
.tm7-linklist { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; }
.tm7-linklist li { margin: 0; padding: 0; }
.tm7-linklist li::before { display: none !important; }
.tm7-linklist a { display: block; padding: .8rem 1rem; border: 1px solid var(--ay-line); border-radius: var(--ay-radius); text-decoration: none; color: var(--ay-ink); font-weight: 600; background: var(--ay-cream); }
.tm7-linklist a:hover { border-color: var(--ay-saffron); }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .tm7-linklist .l-2 { opacity: .75; font-weight: 400; }
:where(html:not([data-tmk-lang="en"]):not([data-tmk-lang="ta"])) .page-title h1 .l-2 { font-size: .55em; margin-top: .3em; }

@media (prefers-reduced-motion: reduce) {
	.tamilmanam *, .tamilmanam *::before, .tamilmanam *::after { transition: none !important; animation: none !important; }
}
@media print {
	.masthead, .top-bar, #footer .widget_nav_menu, .tml-float { display: none !important; }
	#footer, #bottom-bar { background: none !important; color: #000 !important; }
}
