/*
Theme Name: Prerana
Theme URI: https://example.com/prerana
Author: Prerana Institute of Allied Health Sciences
Description: Theme for Prerana Institute of Allied Health Sciences, Bagalkot. Shared header and footer for every page, with the page content built in the free Elementor plugin. Go to Appearance > Prerana Setup to create all pages, menus and Elementor colours/fonts in one click. Gallery, team, facilities and enquiry forms come from the companion plugin "Prerana College Toolkit".
Version: 1.1.1
Requires at least: 6.3
Tested up to: 6.8
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: prerana
Tags: education, custom-logo, custom-menu, full-width-template, threaded-comments
*/

/* =====================================================
   PRERANA — colours are at the top.
   1. Base  2. Buttons  3. Top bar  4. Header + menu
   5. Footer + mobile call bar  6. Blog / plain pages
   7. Inside Elementor pages  8. Tablet  9. Mobile
   (Page content colours/fonts live in Elementor > Site Settings.)
===================================================== */

:root {
  --navy: #252E73;
  --navy-dark: #171D52;
  --green: #4C963D;
  --gold: #D69B17;
  --bg: #FFFFFF;
  --tint: #F5F7F1;
  --text: #17213D;
  --muted: #5C667A;
  --line: #DDE2E8;
  --radius: 10px;
}

/* ---------- 1. Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font-family: "DM Sans", "Segoe UI", system-ui, sans-serif; font-size: 17px; line-height: 1.65; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { font-family: "Manrope", "Segoe UI", system-ui, sans-serif; line-height: 1.2; margin: 0 0 16px; letter-spacing: -.02em; }
p { margin: 0 0 16px; }
figure { margin: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed !important; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto; padding: 10px 16px; background: #fff; color: var(--navy); border-radius: 8px; }

/* ---------- 2. Buttons (header, footer, plain pages) ---------- */
.btn { display: inline-block; padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15.5px; line-height: 1.3; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit; transition: background .2s, color .2s, border-color .2s; }
a.btn.btn-gold, a.btn.btn-gold:hover { color: #1a1400; }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #e6ad2c; }
a.btn.btn-navy, a.btn.btn-navy:hover { color: #fff; }
.btn-navy { background: var(--navy); }
.btn-navy:hover { background: var(--green); }

/* ---------- 3. Top bar ---------- */
.topbar { background: var(--navy-dark); color: #fff; font-size: 14px; }
.topbar-in { display: flex; gap: 28px; padding-top: 8px; padding-bottom: 8px; }
.topbar .topbar-in a, .topbar .topbar-in a:hover { color: #fff; text-decoration: none; font-weight: 600; }
.topbar-in > :last-child { margin-left: auto; }

/* ---------- 4. Header + menu ---------- */
.header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.admin-bar .header { top: 32px; }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand strong { display: block; font-family: "Manrope", sans-serif; font-weight: 800; font-size: 16px; line-height: 1.2; color: var(--navy); max-width: 22ch; }
.brand small { color: var(--muted); font-size: 13px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav .menu { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav .menu li { position: relative; }
.nav .menu a { display: inline-block; text-decoration: none; font-weight: 500; font-size: 15.5px; padding: 6px 0; border-bottom: 2px solid transparent; color: var(--text); }
.nav .menu > li > a:hover { border-color: var(--gold); }
.nav .menu > .current-menu-item > a,
.nav .menu > .current-menu-ancestor > a,
.nav .menu > .current-page-ancestor > a { border-color: var(--gold); color: var(--navy); font-weight: 600; }
.menu-item-has-children { display: flex; align-items: center; gap: 2px; }
.nav .drop-btn { width: 26px; height: 26px; display: grid; place-items: center; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 6px; color: var(--navy); }
.nav .drop-btn:hover, .nav .drop-btn:focus { background: var(--tint); }
.drop-btn span { width: 7px; height: 7px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.is-open > .drop-btn span { transform: translateY(1px) rotate(225deg); }
.nav .sub-menu { display: none; position: absolute; top: 100%; left: -18px; z-index: 60; min-width: 250px; list-style: none; margin: 0; padding: 8px 0; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 14px 28px rgba(23, 33, 61, .12); }
.nav .sub-menu a { display: block; padding: 9px 18px; border: 0; font-size: 15px; }
.nav .sub-menu a:hover, .nav .sub-menu .current-menu-item > a { background: var(--tint); color: var(--navy); }
.nav .is-open > .sub-menu { display: block; }
@media (min-width: 1041px) {
  .nav .menu-item-has-children:hover > .sub-menu,
  .nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
}
.header .menu-btn { display: none; width: 46px; height: 46px; background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; padding: 12px 11px; margin: 0; }
.menu-btn i { display: block; height: 2px; background: var(--navy); margin-bottom: 6px; }
.menu-btn i:last-child { margin: 0; }

/* ---------- 5. Footer + mobile call bar ---------- */
.footer { background: var(--navy-dark); color: rgba(255, 255, 255, .82); padding-top: 56px; font-size: 15.5px; }
.footer-in { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 32px; }
.footer strong { font-family: "Manrope", sans-serif; color: #fff; font-size: 17px; display: block; margin-bottom: 10px; }
.footer h4 { color: var(--gold); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer .footer-in a { display: block; color: rgba(255, 255, 255, .82); text-decoration: none; padding: 3px 0; overflow-wrap: anywhere; }
.footer .footer-in a:hover { color: #fff; text-decoration: underline; }
.copy { text-align: center; margin: 40px 0 0; padding: 18px 24px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: 14px; }
.callbar { display: none; }

/* ---------- 6. Blog / plain pages (pages not built with Elementor) ---------- */
.page-plain { padding: clamp(48px, 7vw, 88px) 0; }
.page-plain .wrap { max-width: 860px; }
.page-plain h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; color: var(--navy); }
.page-plain .entry-content a { color: var(--navy); }
.entry-meta { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.post-list article { padding: 28px 0; border-bottom: 1px solid var(--line); }
.post-list h2 { font-size: 24px; font-weight: 800; }
.post-list h2 a { text-decoration: none; color: var(--navy); }
.pagination { margin-top: 32px; display: flex; gap: 10px; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- 7. Inside Elementor pages ----------
   Keeps Elementor content lined up with the header on smaller screens,
   and styles the two HTML-widget pieces (breadcrumb, course table). */
/* Top-level sections line up with the header (1112px content, 24px side gutter) */
@media (max-width: 1160px) {
  .elementor-top-section.elementor-section-boxed > .elementor-container { padding-left: 24px; padding-right: 24px; }
}
/* Rows of cards (inner sections with the CSS class "p-grid"): outer edges line up with the headings above */
.elementor-section.p-grid > .elementor-container { margin-left: -12px; margin-right: -12px; width: auto; max-width: none; }
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }

.crumbs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: #fff; }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .55; }
.crumbs li a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.crumbs li a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: var(--gold); font-weight: 600; }

.courses { width: 100%; border-collapse: collapse; margin: 0; font-size: 16.5px; }
.courses th { text-align: left; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border: 0; border-bottom: 2px solid var(--navy); background: none; }
.courses td { padding: 20px 16px; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; background: none; }
.courses td strong { display: block; font-family: "Manrope", sans-serif; font-size: 19px; color: var(--navy); }
.courses td strong a, .courses td strong a:hover { color: var(--navy); text-decoration: none; }
.courses td strong a:hover { text-decoration: underline; }
.courses td span { display: block; color: var(--muted); font-size: 15px; max-width: 46ch; }
.courses tbody tr:hover td { background: var(--tint); }
.courses td:last-child { text-align: right; white-space: nowrap; }
a.btn-small { display: inline-block; padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px; line-height: 1.3; text-decoration: none; border: 2px solid var(--navy); color: var(--navy); transition: background .2s, color .2s; }
.courses a.btn-small:hover, a.btn-small:hover { background: var(--navy); color: #fff; }
.courses .btn-small + .btn-small { margin-left: 6px; }

/* Spot reserved for your own plugin (gallery, form, slider) */
.plugin-spot { border: 1px dashed #B9C1CC; background: var(--tint); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); font-size: 15px; }
.plugin-spot strong { display: block; color: var(--navy); font-family: "Manrope", sans-serif; font-size: 18px; margin-bottom: 6px; }
.plugin-spot code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 14px; }

/* ---------- 8. Tablet ---------- */
@media (max-width: 1040px) {
  .header .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 20px; box-shadow: 0 12px 24px rgba(23, 33, 61, .1); max-height: calc(100vh - 120px); overflow-y: auto; }
  .nav.is-open { display: flex; }
  .nav .menu { flex-direction: column; align-items: stretch; gap: 0; }
  .nav .menu > li { border-bottom: 1px solid var(--line); }
  .nav .menu a { display: block; padding: 13px 0; border: 0; }
  .menu-item-has-children { display: grid; grid-template-columns: 1fr auto; }
  .nav .drop-btn { width: 44px; height: 44px; }
  .nav .sub-menu { position: static; grid-column: 1 / -1; min-width: 0; border: 0; box-shadow: none; border-radius: 0; padding: 0 0 10px 14px; }
  .nav .sub-menu a { padding: 9px 0; }
  .nav .sub-menu a:hover, .nav .sub-menu .current-menu-item > a { background: none; font-weight: 600; }
  .nav .btn { margin-top: 16px; text-align: center; }
  .footer-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 782px) {
  .admin-bar .header { top: 46px; }
}
@media (max-width: 600px) {
  .admin-bar .header { top: 0; }
}

/* ---------- 9. Mobile ---------- */
@media (max-width: 767px) {
  body { font-size: 16px; padding-bottom: 58px; }
  .topbar-hide { display: none; }
  .brand strong { font-size: 14.5px; }
  .brand img { width: 46px; height: 46px; }

  /* Course table becomes one block per course */
  .courses thead { display: none; }
  .courses, .courses tbody, .courses tr, .courses td { display: block; }
  .courses tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; background: #fff; }
  .courses td { border: 0; padding: 4px 0; }
  .courses td[data-label]:not(:first-child) { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 9px 0; }
  .courses td[data-label]:not(:first-child)::before { content: attr(data-label); color: var(--muted); }
  .courses td:first-child { padding-bottom: 12px; }
  .courses td:last-child { text-align: left; padding-top: 12px; white-space: normal; }
  .courses td:last-child .btn-small { display: block; text-align: center; }
  .courses .btn-small + .btn-small { margin: 8px 0 0; }
  .courses tbody tr:hover td { background: none; }

  .callbar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; }
  .callbar a.callbar-call { padding: 16px; text-align: center; font-weight: 700; text-decoration: none; background: #fff; color: var(--navy); border-top: 1px solid var(--line); }
  .callbar a.callbar-enquire { padding: 16px; text-align: center; font-weight: 700; text-decoration: none; background: var(--gold); color: #1a1400; border-top: 1px solid var(--gold); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
