/* A Linguist's Take — core PHP site */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Fira Sans', 'Noto Sans', Arial, sans-serif;
    font-size: 1rem;
    color: #353b41;
    background: #c3d3e8;
}
a { color: #30638d; text-decoration: none; }
a:hover { color: #1a1918; text-decoration: underline; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 3px; }
.container { max-width: 70em; margin: 0 auto; padding: 0 16px; }

/* Header — Mithila (Madhubani) painting banner behind the menu */
.site-header {
    background: #f7e6c4 url('../images/mithila-header.svg') center center / cover no-repeat;
    position: relative;
}
.site-header::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(20, 10, 6, 0.42); z-index: 0;
}
.site-header > .container {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap;
    gap: 14px; width: 100%; min-height: 60px;
}
.site-logo { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.site-logo:hover { text-decoration: none; }
.site-logo-img { height: 38px; width: auto; border-radius: 4px; }
.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; margin-left: auto; }
.main-nav { flex: 1 1 auto; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; gap: 2px; justify-content: flex-start; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a { display: block; color: #fff; padding: 7px 9px; border-radius: 6px; text-shadow: 0 1px 3px #000; font-size: .92rem; white-space: nowrap; }
.main-nav > ul > li > a:hover { background: #f8bb19; color: #111; text-decoration: none; text-shadow: none; }
.main-nav .submenu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.3); list-style: none; margin: 0; padding: 6px 0; min-width: 200px; z-index: 50; }
.main-nav .has-children:hover > .submenu, .main-nav .has-children:focus-within > .submenu { display: block; }
.main-nav .submenu a { display: block; padding: 8px 14px; color: #1a2a44; white-space: nowrap; }
.main-nav .submenu a:hover { background: #f8bb19; text-decoration: none; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-sitename { color: #fff; font-family: Roboto, sans-serif; font-size: 1.05rem; font-weight: 700; text-shadow: 0 1px 4px #000; white-space: nowrap; }
.header-sitename:hover { color: #f8bb19; text-decoration: none; }

.site-main { padding: 20px 0 40px; min-height: 60vh; }
.blog-list { background: rgba(235,245,245,.98); border-radius: 8px; padding: 20px; }
.page-header { margin-top: 0; font-family: Roboto, sans-serif; border-bottom: 2px solid #f8bb19; padding-bottom: 8px; }

.blog-item { background: #fff; border-radius: 8px; padding: 16px 18px; margin-bottom: 18px; box-shadow: 0 2px 5px rgba(0,0,0,.08); }
.blog-item.featured { border-left: 5px solid #f8bb19; }
.blog-item h3 { margin: 0 0 8px; font-size: 1.25rem; }
.article-meta { color: #6c757d; font-size: .9rem; margin-bottom: 10px; }
.article-body { line-height: 1.75; }
.article-body img { max-width: 100%; height: auto; }
.readmore { display: inline-block; margin-top: 10px; font-weight: 600; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 18px; }
.category-desc { margin-bottom: 18px; line-height: 1.7; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.pagination a { padding: 7px 12px; background: #fff; border: 1px solid #ced4da; border-radius: 6px; }
.pagination a.active, .pagination a:hover { background: #f8bb19; border-color: #f8bb19; text-decoration: none; }

.single-article { background: rgba(235,245,245,.98); border-radius: 8px; padding: 24px; }
.single-article .article-body { background: #fff; border-radius: 8px; padding: 18px; }
.comments { margin-top: 24px; }
.comment { background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.comment h4 { margin: 6px 0; }

.search-form { display: flex; gap: 10px; margin-bottom: 20px; }
.search-form input { flex: 1; padding: 10px; border: 1px solid #ced4da; border-radius: 6px; font-size: 1rem; }
.btn { display: inline-block; padding: 9px 16px; background: #f8bb19; color: #111; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn:hover { background: #e0a800; text-decoration: none; color: #111; }

.contact-details { background: #fff; border-radius: 8px; padding: 20px; line-height: 1.8; }

.gallery-grid, .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.gallery-card { background: #fff; border-radius: 8px; padding: 14px; }
.photo-item { display: block; background: #fff; border-radius: 8px; overflow: hidden; }
.photo-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.photo-item span { display: block; padding: 8px; font-size: .85rem; color: #444; }

.site-footer { background: #1a2a44; color: #fff; padding: 24px 0; text-align: center; }
.site-footer p { margin: 5px 0; }
.site-footer .social a { color: #f8bb19; margin: 0 10px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav { display: none; width: 100%; }
    .main-nav.open { display: block; }
    .main-nav > ul { flex-direction: column; }
    .main-nav .submenu { position: static; display: none; }
    .main-nav .has-children.open > .submenu { display: block; }
    .blog-grid { grid-template-columns: 1fr; }
}

/* Admin */
.admin-section { background: rgba(235,245,245,.98); border-radius: 8px; padding: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.admin-form { max-width: 750px; background: #fff; border-radius: 8px; padding: 22px; }
.admin-form .form-group { margin-bottom: 16px; }
.admin-form label { display: block; font-weight: 600; margin-bottom: 5px; }
.admin-form input[type=text], .admin-form input[type=email], .admin-form input[type=password], .admin-form select, .admin-form textarea { width: 100%; padding: 9px; border: 1px solid #ced4da; border-radius: 6px; font-size: 1rem; }
.btn-outline { background: #fff; color: #30638d; border: 1px solid #ced4da; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 14px; margin: 18px 0; }
.stat-card { background:#fff; border-radius:8px; padding:16px; text-align:center; }
.stat-card h3 { margin:0; font-size:1.8rem; }
.table-wrap { overflow-x:auto; }
table { border-collapse: collapse; width:100%; background:#fff; border-radius:8px; }
th, td { padding:10px 12px; text-align:left; border-bottom:1px solid #ddd; }
th { background:#f8f9fa; }
.checkbox-label { display:inline-flex; align-items:center; gap:6px; margin-right:20px; }

/* WYSIWYG editor */
.wysiwyg { border:1px solid #ced4da; border-radius:8px; overflow:hidden; background:#fff; }
.wysi-toolbar { display:flex; flex-wrap:wrap; gap:3px; padding:6px; background:#f2f5f9; border-bottom:1px solid #ced4da; }
.wysi-btn { min-width:30px; padding:5px 9px; font-size:.85rem; border:1px solid #ced4da; background:#fff; color:#1a2a44; border-radius:4px; cursor:pointer; }
.wysi-btn:hover { background:#f8bb19; }
.wysi-btn.active { background:#30638d; color:#fff; }
.wysi-sep { width:1px; height:20px; background:#ced4da; margin:0 4px; }
.wysi-editor { min-height:260px; max-height:520px; overflow-y:auto; padding:16px 18px; outline:none; line-height:1.7; }
.wysi-editor:focus { box-shadow:inset 0 0 0 2px rgba(48,99,141,.25); }
.wysi-editor h2,.wysi-editor h3 { border:none; color:#1a2a44; }
.wysi-editor blockquote { border-left:4px solid #f8bb19; margin:12px 0; padding:6px 14px; background:#f8f9fa; }
.wysi-editor pre { background:#f4f6f8; border:1px solid #e2e6ea; padding:10px; border-radius:4px; }
.wysi-editor img { max-width:100%; height:auto; }
textarea.wysi-source { width:100%; min-height:260px; padding:16px; border:1px solid #ced4da; border-radius:4px; font-family:Consolas,Monaco,monospace; font-size:.9rem; }
.form-section { margin:24px 0; padding:18px; background:#f8f9fa; border-radius:8px; border:1px solid #e9ecef; }
.form-section h3 { margin-top:0; font-size:1.1rem; color:#1a2a44; }
.form-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }
.preview-banner { background:#fff3cd; color:#7a5200; border:1px solid #ffd97d; padding:12px 16px; border-radius:8px; margin-bottom:16px; text-align:center; font-weight:600; }
.small { font-size:.85rem; color:#6c757d; }
.code-inline { background:#eef2f7; padding:1px 5px; border-radius:3px; }

/* Profile dropdown */
.user-menu { position: relative; }
.user-avatar { display:inline-flex; align-items:center; gap:6px; background:rgba(248,187,25,.2); border:1px solid rgba(255,255,255,.4); border-radius:24px; padding:3px 9px 3px 3px; cursor:pointer; color:#fff; font-size:.8rem; }
.user-avatar:hover { background:rgba(248,187,25,.35); }
.avatar-letter { width:28px; height:28px; border-radius:50%; background:#f8bb19; color:#111; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:.9rem; }
.avatar-caret { opacity:.85; }
.user-dropdown { display:none; position:absolute; right:0; top:calc(100% + 8px); min-width:215px; background:#fff; border:1px solid #dde3ea; border-radius:8px; box-shadow:0 10px 28px rgba(0,0,0,.28); z-index:200; overflow:hidden; }
.user-dropdown.show { display:block; }
.user-info { padding:12px 14px; border-bottom:1px solid #eee; background:#f7f9fc; display:flex; flex-direction:column; gap:3px; }
.user-info strong { color:#1a2a44; }
.user-role { color:#6c757d; font-size:.75rem; text-transform:uppercase; letter-spacing:.6px; }
.user-dropdown a { display:block; padding:10px 14px; color:#1a2a44; text-decoration:none; font-size:.9rem; }
.user-dropdown a:hover { background:#f0f4fa; color:#30638d; text-decoration:none; }
.user-dropdown .logout-link { color:#a51f18; border-top:1px solid #eee; }
.profile-card { display:flex; gap:18px; align-items:center; background:#fff; border-radius:8px; padding:22px; margin-bottom:20px; }
.profile-avatar { width:64px; height:64px; border-radius:50%; background:#f8bb19; color:#111; display:flex; align-items:center; justify-content:center; font-size:1.8rem; font-weight:700; }
.profile-info p { margin:5px 0; }

/* Photo albums */
.album-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:18px; }
.album-tile { display:block; background:#fff; border-radius:10px; overflow:hidden; box-shadow:0 3px 12px rgba(0,0,0,.12); transition:transform .2s,box-shadow .2s; }
.album-tile:hover { transform:translateY(-3px); box-shadow:0 8px 20px rgba(0,0,0,.2); text-decoration:none; }
.album-cover { position:relative; height:165px; overflow:hidden; background:#e9ecef; }
.album-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.album-placeholder { display:flex; align-items:center; justify-content:center; height:100%; font-size:3rem; }
.album-count { position:absolute; bottom:8px; right:8px; background:rgba(0,0,0,.65); color:#fff; font-size:.75rem; padding:3px 8px; border-radius:12px; }
.album-title { padding:12px 14px; font-weight:600; color:#1a2a44; min-height:48px; }

/* Slideshow */
.slideshow { background:#fff; border-radius:10px; padding:16px; }
.slide-stage { position:relative; background:#111; border-radius:8px; overflow:hidden; display:flex; align-items:center; justify-content:center; min-height:420px; }
.slide-stage img { max-width:100%; max-height:560px; display:block; }
.slide-nav { position:absolute; top:50%; transform:translateY(-50%); background:rgba(255,255,255,.85); border:none; border-radius:50%; width:44px; height:44px; font-size:1.8rem; line-height:1; cursor:pointer; color:#111; }
.slide-nav:hover { background:#f8bb19; }
.slide-nav.prev { left:12px; }
.slide-nav.next { right:12px; }
.slide-caption { position:absolute; bottom:0; left:0; right:0; background:rgba(0,0,0,.65); color:#fff; padding:10px 16px; font-size:.9rem; text-align:center; }
.slide-counter { text-align:center; color:#6c757d; font-size:.85rem; padding:10px 0 4px; }
.thumbs { display:flex; gap:8px; overflow-x:auto; padding:10px 2px; }
.thumb { flex:0 0 auto; padding:0; border:3px solid transparent; border-radius:6px; overflow:hidden; background:none; cursor:pointer; }
.thumb img { width:80px; height:60px; object-fit:cover; display:block; }
.thumb:hover, .thumb.active { border-color:#f8bb19; }

/* Video embeds */
.video-embed { position:relative; width:100%; max-width:640px; aspect-ratio:16/9; margin:16px 0; border-radius:8px; overflow:hidden; }
.video-embed iframe { width:100%; height:100%; border:0; display:block; }

/* Comments + secure form */
.comments { margin-top:28px; }
.comment { background:#fff; border-radius:8px; padding:14px 16px; margin-bottom:12px; }
.comment-head { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
.comment p { margin:4px 0; line-height:1.6; }
.comment-form { background:#fff; border-radius:8px; padding:20px; margin-top:14px; }
.comment-form .form-group { margin-bottom:12px; }
.comment-form label { display:block; font-weight:600; margin-bottom:4px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form textarea { width:100%; padding:9px; border:1px solid #ced4da; border-radius:6px; font-size:1rem; }
.honeypot { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.comment-form .form-row { display:flex; gap:14px; flex-wrap:wrap; }
.comment-form .form-col { flex:1; min-width:220px; }
.moderation-item { border-left:4px solid #f8bb19; }
.badge-approved, .badge-pending { font-size:.72rem; padding:2px 8px; border-radius:10px; }
.badge-approved { background:#d4edda; color:#155724; }
.badge-pending { background:#fff3cd; color:#7a5200; }

/* Comment replies */
.comment-reply { margin-left:32px; border-left:3px solid #f8bb19; background:#fffdf5; }
.badge-reply { background:#fff3cd; color:#7a5200; font-size:.7rem; padding:2px 7px; border-radius:10px; }
.quote-ref { color:#6c757d; font-style:italic; font-size:.9rem; }
.reply-btn { margin-top:6px; }
