/*
Theme Name: CDVS Academic Theme
Theme URI: https://cdvs.edu.in
Author: Center of Dhamma Vinaya Studies
Author URI: https://cdvs.edu.in
Description: A professional academic institution theme for the Center of Dhamma Vinaya Studies. Features full header, sticky navigation with dropdowns, hero slider, two-column layout with sidebar, admin-friendly widgets, and a rich footer. Built for WordPress 6.x.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: cdvs-theme
Tags: education, academic, buddhism, institution, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, sticky-post, threaded-comments, translation-ready
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; line-height: 1.75; color: #333; background: #F2F1ED; }
a { color: #6B1A1A; text-decoration: none; }
a:hover { color: #C9A84C; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-family: Georgia, serif; line-height: 1.3; }

/* ===== CSS VARIABLES ===== */
:root {
  --maroon: #6B1A1A;
  --maroon-dark: #4A1010;
  --maroon-deep: #3a0808;
  --gold: #C9A84C;
  --gold-dark: #A88030;
  --navy: #1A2E5C;
  --light-bg: #F5F5F5;
  --border: #ddd;
  --text: #333;
  --text-muted: #666;
  --sans: Arial, Helvetica, sans-serif;
}

/* ===== UTILITY ===== */
.sans { font-family: var(--sans); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; left: -9999px; }
.skip-link { position: absolute; top: -40px; left: 0; background: var(--maroon); color: #fff; padding: 8px 14px; z-index: 9999; font-family: var(--sans); font-size: 13px; }
.skip-link:focus { top: 0; }
.btn { display: inline-block; background: var(--maroon); color: #fff; padding: 10px 22px; border-radius: 4px; font-family: var(--sans); font-size: 14px; font-weight: 700; border: none; cursor: pointer; transition: background 0.2s; }
.btn:hover { background: var(--maroon-dark); color: #fff; }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }

/* ===== TOP BAR ===== */
#site-top-bar { background: var(--maroon-deep); color: rgba(255,255,255,0.7); font-family: var(--sans); font-size: 12px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
#site-top-bar .top-bar-inner { display: flex; justify-content: space-between; align-items: center; }
#site-top-bar .top-contact a { color: rgba(255,255,255,0.7); margin-right: 18px; }
#site-top-bar .top-contact a:hover { color: var(--gold); }
#site-top-bar .top-lang button { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); padding: 3px 10px; border-radius: 3px; font-size: 11px; cursor: pointer; font-family: var(--sans); }
#site-top-bar .top-lang button:hover { background: rgba(255,255,255,0.2); }

/* ===== HEADER ===== */
#masthead { background: var(--maroon); color: #fff; padding: 16px 0; }
#masthead .header-inner { display: flex; align-items: center; gap: 20px; }
#masthead .site-logo { width: 72px; height: 72px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
#masthead .site-logo img { width: 100%; height: 100%; object-fit: cover; }
#masthead .site-logo .logo-text { color: var(--maroon); font-weight: 700; font-size: 16px; font-family: var(--sans); text-align: center; line-height: 1.2; }
#masthead .site-branding { flex: 1; }
#masthead .site-title { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 0.3px; margin-bottom: 4px; }
#masthead .site-title a { color: #fff; }
#masthead .site-description { font-family: var(--sans); font-size: 12px; color: rgba(255,255,255,0.65); }
#masthead .header-social { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
#masthead .social-icons { display: flex; gap: 6px; }
#masthead .social-icons a { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,0.25); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--sans); font-size: 12px; font-weight: 700; }
#masthead .social-icons a:hover { background: rgba(255,255,255,0.15); color: var(--gold); }
#masthead .header-search input { padding: 6px 10px; border-radius: 3px 0 0 3px; border: none; font-size: 13px; width: 180px; font-family: var(--sans); }
#masthead .header-search button { padding: 6px 12px; background: var(--gold); color: #fff; border: none; border-radius: 0 3px 3px 0; font-size: 13px; cursor: pointer; font-family: var(--sans); font-weight: 700; }
#masthead .header-search button:hover { background: var(--gold-dark); }

/* ===== NAVIGATION ===== */
#site-navigation { background: var(--maroon-dark); position: sticky; top: 0; z-index: 500; }
#site-navigation .nav-inner { display: flex; align-items: stretch; }
#site-navigation ul { display: flex; flex-wrap: wrap; align-items: stretch; }
#site-navigation ul li { position: relative; }
#site-navigation ul li a { display: flex; align-items: center; padding: 13px 15px; color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; transition: all 0.2s; }
#site-navigation ul li a:hover,
#site-navigation ul li.current-menu-item > a,
#site-navigation ul li.current-menu-parent > a { background: var(--maroon); color: var(--gold); border-bottom-color: var(--gold); }
#site-navigation ul li.menu-item-admissions > a { color: var(--gold); font-weight: 700; }
#site-navigation ul li.menu-item-admissions:hover > a { background: var(--gold); color: var(--maroon-dark); }
#site-navigation ul .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 210px; border-top: 3px solid var(--gold); box-shadow: 0 4px 12px rgba(0,0,0,0.12); z-index: 600; }
#site-navigation ul li:hover > .sub-menu { display: block; }
#site-navigation ul .sub-menu li a { padding: 10px 16px; color: #333; font-size: 13px; font-weight: 400; border-bottom: 1px solid #f0f0f0; border-bottom-color: #f0f0f0 !important; background: #fff; transition: padding-left 0.15s; }
#site-navigation ul .sub-menu li a:hover { background: var(--light-bg); color: var(--maroon); padding-left: 22px; border-bottom-color: #f0f0f0; }
#site-navigation ul .sub-menu li:last-child a { border-bottom: none; }
.menu-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 8px 12px; margin: 8px; border-radius: 3px; font-family: var(--sans); font-size: 13px; cursor: pointer; }

/* ===== HERO / SLIDER ===== */
#hero-slider { position: relative; overflow: hidden; min-height: 360px; }
.slide { display: none; min-height: 360px; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 30px; color: #fff; position: relative; }
.slide.active { display: flex; }
.slide::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.38); }
.slide-content { position: relative; z-index: 2; max-width: 720px; }
.slide-title { font-size: 32px; font-weight: 700; margin-bottom: 14px; line-height: 1.3; }
.slide-desc { font-family: var(--sans); font-size: 15px; margin-bottom: 24px; opacity: 0.92; }
.slide-cta { display: inline-block; background: var(--gold); color: #fff; padding: 12px 28px; border-radius: 4px; font-family: var(--sans); font-size: 14px; font-weight: 700; }
.slide-cta:hover { background: var(--gold-dark); color: #fff; }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.3); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.slider-arrow:hover { background: rgba(0,0,0,0.55); }
.slider-prev { left: 14px; }
.slider-next { right: 14px; }
.slider-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 10; }
.slider-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.45); cursor: pointer; border: none; padding: 0; }
.slider-dot.active { background: #fff; }

/* ===== BREADCRUMBS ===== */
#breadcrumbs { background: #fff; border-bottom: 1px solid var(--border); padding: 10px 0; font-family: var(--sans); font-size: 13px; color: var(--text-muted); }
#breadcrumbs a { color: var(--maroon); }
#breadcrumbs a:hover { color: var(--gold); }

/* ===== MAIN LAYOUT ===== */
#content { padding: 36px 0 40px; }
#primary { flex: 0 0 68%; max-width: 68%; }
#secondary { flex: 0 0 29%; max-width: 29%; }
.content-area { display: flex; gap: 3%; align-items: flex-start; }

/* ===== SECTION HEADINGS ===== */
.section-heading { font-size: 22px; color: var(--maroon); font-weight: 700; padding-bottom: 10px; border-bottom: 3px solid var(--gold); margin-bottom: 24px; }

/* ===== WELCOME SECTION ===== */
.welcome-section { margin-bottom: 44px; background: #fff; padding: 28px; border-radius: 6px; border: 1px solid var(--border); }
.welcome-section p { color: #444; margin-bottom: 14px; font-size: 15px; }

/* ===== NEWS GRID ===== */
.news-section { margin-bottom: 44px; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.news-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; transition: box-shadow 0.2s; }
.news-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.09); }
.news-card-top { height: 90px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.news-card-body { padding: 16px; }
.news-date { font-family: var(--sans); font-size: 12px; color: #aaa; margin-bottom: 6px; }
.news-title { font-size: 14px; font-weight: 700; color: #222; margin-bottom: 8px; line-height: 1.45; }
.news-excerpt { font-family: var(--sans); font-size: 13px; color: #666; line-height: 1.55; margin-bottom: 10px; }
.news-read-more { font-family: var(--sans); font-size: 13px; color: var(--maroon); font-weight: 700; }
.news-read-more:hover { color: var(--gold); }

/* ===== EVENTS ===== */
.events-section { margin-bottom: 44px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 24px; }
.event-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid #efefef; align-items: flex-start; }
.event-item:last-child { border-bottom: none; padding-bottom: 0; }
.event-date { flex-shrink: 0; width: 56px; height: 56px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.event-day { font-size: 22px; font-weight: 700; line-height: 1; }
.event-month { font-family: var(--sans); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.event-info h4 { font-size: 14px; font-weight: 700; color: #222; margin-bottom: 4px; }
.event-info p { font-family: var(--sans); font-size: 13px; color: #888; }

/* ===== PROGRAMS ===== */
.programs-section { margin-bottom: 44px; }
.programs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.program-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 22px; text-align: center; transition: box-shadow 0.2s; }
.program-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.09); }
.program-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 700; }
.program-card h3 { font-size: 15px; color: var(--maroon); font-weight: 700; margin-bottom: 8px; }
.program-card p { font-family: var(--sans); font-size: 13px; color: #666; line-height: 1.55; }

/* ===== SIDEBAR ===== */
#secondary { }
.widget { background: #fff; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 22px; overflow: hidden; }
.widget-title { background: var(--maroon); color: #fff; padding: 10px 16px; font-size: 14px; font-weight: 700; font-family: var(--sans); margin: 0; }
.widget-content { padding: 14px 16px; }
.widget ul li { border-bottom: 1px solid #f0f0f0; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { display: block; padding: 8px 0; font-family: var(--sans); font-size: 13px; color: #333; transition: padding-left 0.15s; }
.widget ul li a:before { content: '›'; margin-right: 6px; color: var(--maroon); }
.widget ul li a:hover { color: var(--maroon); padding-left: 4px; }
.notice-item { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-family: var(--sans); font-size: 13px; color: #444; line-height: 1.45; }
.notice-item:last-child { border-bottom: none; }
.notice-date { font-size: 11px; color: #bbb; display: block; margin-top: 3px; }
.notice-board-inner { max-height: 220px; overflow-y: auto; }
.widget .search-form { display: flex; gap: 0; }
.widget .search-form input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 3px 0 0 3px; font-size: 13px; font-family: var(--sans); }
.widget .search-form button { padding: 8px 13px; background: var(--maroon); color: #fff; border: none; border-radius: 0 3px 3px 0; font-size: 13px; cursor: pointer; font-family: var(--sans); font-weight: 700; }
.widget .search-form button:hover { background: var(--maroon-dark); }
.gallery-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-thumb { aspect-ratio: 1; border-radius: 4px; overflow: hidden; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.gallery-thumb img:hover { transform: scale(1.07); }
.gallery-placeholder { aspect-ratio: 1; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--sans); font-size: 10px; font-weight: 700; text-align: center; }
.social-feed-box { text-align: center; padding: 16px 0; }
.social-feed-box p { font-family: var(--sans); font-size: 13px; color: #888; margin-bottom: 14px; }
.social-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.social-buttons a { padding: 7px 13px; border-radius: 3px; color: #fff; font-family: var(--sans); font-size: 12px; font-weight: 700; }
.s-fb { background: #3b5998; }
.s-tw { background: #1da1f2; }
.s-yt { background: #c4302b; }

/* ===== SINGLE POST / PAGE ===== */
.entry-header { margin-bottom: 24px; }
.entry-title { font-size: 28px; color: var(--maroon); margin-bottom: 8px; }
.entry-meta { font-family: var(--sans); font-size: 13px; color: #aaa; margin-bottom: 20px; }
.entry-content { background: #fff; padding: 28px; border-radius: 6px; border: 1px solid var(--border); }
.entry-content h2 { font-size: 20px; color: var(--maroon); margin: 22px 0 12px; }
.entry-content h3 { font-size: 17px; color: var(--maroon); margin: 18px 0 10px; }
.entry-content p { margin-bottom: 16px; color: #444; font-size: 15px; }
.entry-content ul, .entry-content ol { margin: 0 0 16px 22px; }
.entry-content ul li, .entry-content ol li { margin-bottom: 6px; font-size: 15px; color: #444; }
.entry-content blockquote { border-left: 4px solid var(--gold); padding: 12px 20px; margin: 20px 0; background: #fdf9f0; font-style: italic; color: #555; }
.entry-content img { border-radius: 4px; margin: 16px 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-family: var(--sans); font-size: 14px; }
.entry-content table th { background: var(--maroon); color: #fff; padding: 10px 14px; text-align: left; }
.entry-content table td { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.entry-content table tr:hover td { background: var(--light-bg); }
.wp-caption { font-family: var(--sans); font-size: 12px; color: #888; text-align: center; margin-top: 4px; }

/* ===== COMMENTS ===== */
.comments-area { background: #fff; padding: 28px; border-radius: 6px; border: 1px solid var(--border); margin-top: 28px; }
.comments-title { font-size: 20px; color: var(--maroon); margin-bottom: 20px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; font-family: var(--sans); margin-bottom: 14px; }
.comment-form label { font-family: var(--sans); font-size: 13px; color: #555; display: block; margin-bottom: 4px; font-weight: 700; }
.comment-form input[type="submit"] { background: var(--maroon); color: #fff; border: none; padding: 10px 22px; border-radius: 4px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--sans); width: auto; }
.comment-form input[type="submit"]:hover { background: var(--maroon-dark); }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0; font-family: var(--sans); }
.pagination a, .pagination span { padding: 8px 13px; border: 1px solid var(--border); border-radius: 4px; color: #333; font-size: 14px; background: #fff; }
.pagination a:hover { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.pagination .current { background: var(--maroon); color: #fff; border-color: var(--maroon); }

/* ===== FOOTER ===== */
#colophon { background: var(--maroon-deep); color: #999; }
.footer-widgets { padding: 44px 0 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.footer-widget h4 { color: var(--gold); font-family: var(--sans); font-size: 14px; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); text-transform: uppercase; letter-spacing: 0.5px; }
.footer-widget p { font-family: var(--sans); font-size: 13px; line-height: 1.8; color: #999; }
.footer-widget ul li { border-bottom: 1px solid rgba(255,255,255,0.06); }
.footer-widget ul li a { display: block; font-family: var(--sans); font-size: 13px; color: #999; padding: 5px 0; }
.footer-widget ul li a:before { content: '›'; margin-right: 7px; color: var(--gold); }
.footer-widget ul li a:hover { color: var(--gold); }
.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-logo-circle { width: 46px; height: 46px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.footer-logo-circle span { color: var(--maroon); font-weight: 700; font-size: 13px; font-family: var(--sans); }
.footer-logo-text { color: var(--gold); font-weight: 700; font-size: 13px; font-family: var(--sans); line-height: 1.4; }
.newsletter-form input[type="email"] { width: 100%; padding: 9px 11px; border: 1px solid rgba(255,255,255,0.12); border-radius: 3px; background: rgba(255,255,255,0.07); color: #fff; font-size: 13px; font-family: var(--sans); margin-bottom: 8px; }
.newsletter-form input[type="email"]::placeholder { color: #666; }
.newsletter-form button { width: 100%; background: var(--gold); color: #fff; padding: 9px; border-radius: 3px; border: none; font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer; }
.newsletter-form button:hover { background: var(--gold-dark); }
.footer-social { display: flex; gap: 7px; margin-top: 13px; }
.footer-social a { width: 32px; height: 32px; border: 1px solid rgba(255,255,255,0.14); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #999; font-family: var(--sans); font-size: 12px; font-weight: 700; }
.footer-social a:hover { color: var(--gold); border-color: var(--gold); }
.footer-bar { border-top: 1px solid rgba(255,255,255,0.07); padding: 14px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-family: var(--sans); font-size: 12px; color: #555; }
.footer-bar a { color: #555; }
.footer-bar a:hover { color: var(--gold); }
.footer-bar-links { display: flex; gap: 18px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .news-grid, .programs-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-widgets { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .content-area { flex-direction: column; }
  #primary, #secondary { flex: 0 0 100%; max-width: 100%; }
  #secondary { order: 2; }
  #site-navigation ul { display: none; flex-direction: column; width: 100%; }
  #site-navigation ul.toggled { display: flex; }
  #site-navigation ul li a { border-bottom: 1px solid rgba(255,255,255,0.08); }
  #site-navigation ul .sub-menu { position: static; box-shadow: none; border-top: none; border-left: 4px solid var(--gold); }
  .menu-toggle { display: block; }
  .header-search { display: none; }
  .slide-title { font-size: 22px; }
  .footer-widgets { grid-template-columns: 1fr; }
  .footer-bar { flex-direction: column; text-align: center; }
  #site-top-bar .top-bar-inner { flex-direction: column; gap: 5px; }
}
@media (max-width: 480px) {
  .news-grid, .programs-grid { grid-template-columns: 1fr; }
  #masthead .header-inner { flex-wrap: wrap; }
  .site-logo { margin: 0 auto; }
  .site-branding { text-align: center; }
  .header-social { display: none; }
}

/* ===== WORDPRESS CORE ALIGNMENTS ===== */
.alignleft { float: left; margin: 0 20px 16px 0; }
.alignright { float: right; margin: 0 0 16px 20px; }
.aligncenter { display: block; margin: 16px auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-block-image { margin: 20px 0; }

/* ===== GUTENBERG BLOCKS ===== */
.wp-block-button .wp-block-button__link { background: var(--maroon); color: #fff; padding: 10px 22px; border-radius: 4px; font-family: var(--sans); font-size: 14px; font-weight: 700; }
.wp-block-pullquote { border-top: 4px solid var(--gold); border-bottom: 4px solid var(--gold); padding: 20px; margin: 24px 0; }
.wp-block-pullquote blockquote { font-size: 18px; font-style: italic; color: var(--maroon); }
.has-maroon-background-color { background: var(--maroon) !important; }
.has-gold-background-color { background: var(--gold) !important; }
.has-maroon-color { color: var(--maroon) !important; }
.has-gold-color { color: var(--gold) !important; }

/* ===== PAGE TEMPLATES ===== */
.page-template-full-width #content .content-area { display: block; }
.page-template-full-width #primary { max-width: 100%; flex: 0 0 100%; }
.admissions-callout { background: var(--maroon); color: #fff; padding: 36px; border-radius: 6px; text-align: center; margin: 30px 0; }
.admissions-callout h2 { color: var(--gold); font-size: 26px; margin-bottom: 12px; }
.admissions-callout p { font-family: var(--sans); font-size: 15px; opacity: 0.9; margin-bottom: 20px; }
