/* =====================
   Reset & Base
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Georgia', serif; color: #333; background: #fff; line-height: 1.7; -webkit-text-size-adjust: 100%; }
#page { display: flex; flex-direction: column; min-height: 100vh; }
a { color: #1b8be0; text-decoration: none; }
a:hover { color: #0d5fa0; text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
table { width: 100%; border-collapse: collapse; }

.wrapper { width: 100%; padding: 0 20px; }

/* =====================
   Header
   ===================== */
#masthead { background: #fff; border-bottom: 3px solid #1b8be0; padding: 12px 0; }
#masthead .wrapper { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
#site-branding { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
#site-logo img { width: 70px; height: 70px; object-fit: contain; flex-shrink: 0; }
#site-logo div { width: 70px; height: 70px; flex-shrink: 0; background: #1b8be0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; }
#site-header { min-width: 0; }
.site-title { font-size: 1.3rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-title a { color: #1b1b1b; }
.site-description { font-size: 0.85rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search { display: flex; flex-shrink: 0; }
.header-search input { padding: 7px 12px; border: 1px solid #ccc; border-radius: 3px 0 0 3px; font-size: 14px; width: 200px; outline: none; }
.header-search input:focus { border-color: #1b8be0; }
.header-search button { padding: 7px 14px; background: #1b8be0; color: #fff; border: none; border-radius: 0 3px 3px 0; cursor: pointer; font-size: 14px; white-space: nowrap; }
.header-search button:hover { background: #0d5fa0; }

/* =====================
   Navigation
   ===================== */
.site-navigation { background: #1b8be0; position: relative; }
.site-navigation .wrapper { position: relative; }
.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 16px; padding: 13px 16px; cursor: pointer; width: 100%; text-align: left; }
.nav-menu { display: flex; flex-wrap: wrap; }
.nav-menu > li > a { display: block; padding: 13px 15px; color: #fff; font-size: 14px; font-weight: 600; transition: background 0.2s; white-space: nowrap; }
.nav-menu > li:hover > a,
.nav-menu > li.active > a { background: #0d5fa0; }
.has-children { position: relative; }
.sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #0d5fa0; min-width: 180px; z-index: 200; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.sub-menu li a { display: block; padding: 10px 16px; color: #fff; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sub-menu li a:hover { background: #0a4a80; text-decoration: none; }
.has-children:hover .sub-menu { display: block; }

/* =====================
   Content Area
   ===================== */
#content { flex: 1; padding: 25px 20px 60px; width: 100%; }
.page-title { font-size: 1.7rem; color: #1b1b1b; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #1b8be0; }

/* =====================
   Home Hero
   ===================== */
.home-hero { background: linear-gradient(135deg, #1b8be0, #0d5fa0); color: #fff; padding: 40px 25px; border-radius: 8px; margin-bottom: 25px; text-align: center; }
.home-hero h1 { font-size: 1.8rem; margin-bottom: 10px; }
.home-hero p { font-size: 1rem; opacity: 0.9; }
.hero-content { margin-top: 14px; font-size: 0.95rem; opacity: 0.92; text-align: center; background: rgba(255,255,255,0.12); border-radius: 6px; padding: 14px 18px; }
.hero-content *, .hero-content p, .hero-content li, .hero-content h1, .hero-content h2, .hero-content h3, .hero-content h4 { text-align: center !important; }
.hero-content a { color: #fff; text-decoration: underline; }

/* Home Page Bottom Content */
.home-page-content { width:100%; margin-top:30px; box-sizing:border-box; }
.hpc-inner { width:100%; background:#f4f9ff; border-radius:8px; padding:30px 40px; box-sizing:border-box; text-align:center; }
.hpc-inner p, .hpc-inner h1, .hpc-inner h2, .hpc-inner h3, .hpc-inner h4, .hpc-inner div, .hpc-inner span { text-align:center !important; }
.hpc-inner p { margin-bottom:10px; font-size:1rem; line-height:1.8; }
.hpc-inner h1,.hpc-inner h2,.hpc-inner h3,.hpc-inner h4 { color:#1b8be0; margin:16px 0 10px; }
.hpc-inner ul,.hpc-inner ol { display:inline-block; text-align:left !important; padding-left:20px; margin-bottom:10px; }
.hpc-inner li { text-align:left !important; margin-bottom:5px; }
.hpc-inner img { max-width:100%; height:auto; margin:0 auto; display:block; border-radius:6px; }
.hpc-inner a { color:#1b8be0; }
.hpc-inner table { min-width:unset; }
@media(max-width:768px){ .hpc-inner{ padding:20px 16px; } }
@media(max-width:480px){ .hpc-inner{ padding:14px 10px; font-size:0.95rem; border-radius:6px; } }

/* =====================
   Home Grid (2-col layout)
   ===================== */
.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; width: 100%; }
.section-title { font-size: 1.1rem; font-weight: bold; color: #1b8be0; border-left: 4px solid #1b8be0; padding-left: 10px; margin-bottom: 18px; }

/* =====================
   Issue Cards
   ===================== */
.issue-card { border: 1px solid #e0e0e0; border-radius: 6px; padding: 18px; margin-bottom: 18px; transition: box-shadow 0.2s; }
.issue-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.issue-card h3 { font-size: 1rem; margin-bottom: 8px; }
.issue-card h3 a { color: #1b1b1b; }
.issue-card h3 a:hover { color: #1b8be0; text-decoration: none; }
.issue-meta { font-size: 13px; color: #888; margin-bottom: 10px; }
.badge { display: inline-block; background: #1b8be0; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.badge.current { background: #27ae60; }

/* =====================
   Article List
   ===================== */
.article-item { padding: 14px 0; border-bottom: 1px solid #eee; }
.article-item:last-child { border-bottom: none; }
.article-item h4 { font-size: 0.95rem; margin-bottom: 5px; }
.article-item h4 a { color: #1b1b1b; }
.article-item h4 a:hover { color: #1b8be0; }
.article-authors { font-size: 13px; color: #555; font-style: italic; }
.article-pages { font-size: 12px; color: #888; }
.btn-pdf { display: inline-block; background: #e74c3c; color: #fff; padding: 4px 10px; border-radius: 3px; font-size: 12px; margin-top: 5px; }
.btn-pdf:hover { background: #c0392b; color: #fff; text-decoration: none; }

/* =====================
   Books
   ===================== */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.book-card { border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; transition: box-shadow 0.2s; }
.book-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.book-cover { width: 100%; height: 200px; background: #f4f4f4; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 40px; }
.book-cover img { width: 100%; height: 200px; object-fit: cover; }
.book-info { padding: 12px; }
.book-info h4 { font-size: 0.9rem; margin-bottom: 5px; color: #1b1b1b; }
.book-info p { font-size: 12px; color: #666; margin-bottom: 3px; }

/* =====================
   Editorial Board
   ===================== */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.board-card { text-align: center; padding: 20px 15px; border: 1px solid #e0e0e0; border-radius: 6px; }
.board-photo { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; background: #e0e0e0; }
.board-card h4 { font-size: 0.95rem; margin-bottom: 4px; }
.board-card p { font-size: 12px; color: #666; margin-bottom: 2px; }

/* =====================
   Gallery
   ===================== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.gallery-item img { width: 100%; height: 170px; object-fit: cover; border-radius: 4px; cursor: zoom-in; transition: opacity 0.2s; }
.gallery-item img:hover { opacity: 0.85; }
.gallery-item p { font-size: 12px; text-align: center; margin-top: 5px; color: #666; }

/* =====================
   Sidebar
   ===================== */
.sidebar { background: #f9f9f9; padding: 18px; border-radius: 6px; height: fit-content; }
.sidebar-widget { margin-bottom: 22px; }
.sidebar-widget:last-child { margin-bottom: 0; }
.sidebar-widget h4 { font-size: 0.95rem; color: #1b8be0; border-bottom: 2px solid #1b8be0; padding-bottom: 8px; margin-bottom: 10px; }
.sidebar-widget ul li { padding: 5px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.sidebar-widget ul li:last-child { border-bottom: none; }
.sidebar-widget ul li a { color: #333; }
.sidebar-widget ul li a:hover { color: #1b8be0; }

/* =====================
   Page Content (static pages)
   ===================== */
.page-content { width: 100%; padding-bottom: 40px; }
.page-content h1 { font-size: 1.7rem; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 2px solid #1b8be0; color: #1b1b1b; }
.page-content h2 { font-size: 1.3rem; margin: 28px 0 12px; color: #1b8be0; }
.page-content h3 { font-size: 1.1rem; margin: 22px 0 10px; color: #0d5fa0; }
.page-content h4 { font-size: 1rem; margin: 16px 0 8px; color: #333; }
.page-content p { margin-bottom: 14px; }
.page-content ul, .page-content ol { padding-left: 25px; margin-bottom: 14px; }
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content ul li, .page-content ol li { margin-bottom: 7px; line-height: 1.7; }
.page-content blockquote { border-left: 4px solid #1b8be0; padding: 10px 20px; background: #f4f9ff; margin: 18px 0; color: #555; }

/* =====================
   Search
   ===================== */
.search-result { padding: 14px 0; border-bottom: 1px solid #eee; }
.search-result h4 { margin-bottom: 5px; }
.search-result p { font-size: 14px; color: #555; }

/* =====================
   Pagination
   ===================== */
.pagination { display: flex; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #ddd; border-radius: 3px; font-size: 14px; color: #333; }
.pagination a:hover { background: #1b8be0; color: #fff; border-color: #1b8be0; text-decoration: none; }
.pagination .current-page { background: #1b8be0; color: #fff; border-color: #1b8be0; }

/* =====================
   Footer
   ===================== */
#colophon { background: #1b1b1b; color: #ccc; padding: 40px 0 0; }
#colophon .wrapper { padding: 0 20px; }
.footer-widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: 1rem; }
.footer-col ul li { padding: 4px 0; }
.footer-col ul li a { color: #aaa; font-size: 14px; }
.footer-col ul li a:hover { color: #fff; }
.footer-col p { font-size: 14px; color: #aaa; margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid #333; padding: 15px 0; text-align: center; font-size: 13px; color: #888; }
.footer-bottom a { color: #aaa; }

/* =====================
   Alerts
   ===================== */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* =====================
   Admin table (shared)
   ===================== */
table th { background: #f4f4f4; padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid #ddd; font-size: 14px; }
table td { padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: middle; font-size: 14px; }
table tr:hover td { background: #fafafa; }

/* =====================
   Tablet — 1024px
   ===================== */
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: 3fr 2fr; }
  .footer-widgets { grid-template-columns: repeat(3, 1fr); }
  .header-search input { width: 160px; }
}

/* =====================
   Tablet — 768px
   ===================== */
@media (max-width: 768px) {
  /* Header */
  #masthead .wrapper { gap: 10px; }
  .site-title { font-size: 1.1rem; }
  .site-description { font-size: 0.78rem; }
  #site-logo img, #site-logo div { width: 55px; height: 55px; }
  .header-search { width: 100%; order: 3; }
  .header-search input { flex: 1; width: auto; }

  /* Nav */
  .menu-toggle { display: block; }
  .nav-menu { display: none; flex-direction: column; width: 100%; background: #1b8be0; }
  .nav-menu.open { display: flex; }
  .nav-menu > li > a { border-bottom: 1px solid rgba(255,255,255,0.12); padding: 12px 16px; }
  .sub-menu { position: static; box-shadow: none; background: #0d5fa0; display: none; }
  .has-children.open .sub-menu { display: block; }
  .sub-menu li a { padding-left: 28px; }

  /* Layout */
  #content { padding: 20px 15px 50px; }
  .home-grid { grid-template-columns: 1fr; }
  .footer-widgets { grid-template-columns: 1fr 1fr; gap: 20px; }

  /* Grids */
  .board-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  /* Typography */
  .home-hero h1 { font-size: 1.4rem; }
  .home-hero { padding: 30px 18px; }
  .page-title { font-size: 1.4rem; }
}

/* =====================
   Mobile — 480px
   ===================== */
@media (max-width: 480px) {
  .wrapper, #content, #colophon .wrapper { padding-left: 12px; padding-right: 12px; }

  /* Header */
  #site-branding { gap: 8px; }
  #site-logo img, #site-logo div { width: 46px; height: 46px; font-size: 20px; }
  .site-title { font-size: 1rem; }
  .site-description { display: none; }

  /* Footer */
  .footer-widgets { grid-template-columns: 1fr; gap: 18px; }

  /* Grids */
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .board-grid { grid-template-columns: repeat(2, 1fr); }

  /* Hero */
  .home-hero { padding: 22px 14px; border-radius: 6px; }
  .home-hero h1 { font-size: 1.2rem; }
  .home-hero p { font-size: 0.9rem; }

  /* Tables — scroll on small screens */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }

  .page-title { font-size: 1.2rem; }
  .pagination a, .pagination span { padding: 5px 9px; font-size: 13px; }
}

/* =====================
   Print
   ===================== */
@media print {
  .site-navigation, .header-search, #colophon, .btn-pdf, .sidebar, .menu-toggle { display: none !important; }
  #masthead { border-bottom: 2px solid #000; }
  a { color: #000; text-decoration: none; }
  .home-grid { grid-template-columns: 1fr; }
}
