/*
Theme Name: Academic Pages
Theme URI: https://github.com/academicpages/academicpages.github.io
Author: Adapted for WordPress
Author URI: https://medbenmiloud.com
Description: A clean academic personal-site theme for researchers, ported to WordPress from the popular academicpages Jekyll theme. Includes Publications, Talks, Teaching and Portfolio post types, a CV page, and an author bio sidebar.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: academicpages
*/

/* ==========================================================================
   VARIABLES
   ========================================================================== */
:root{
  --ap-primary: #2f7f93;
  --ap-primary-dark: #1f5b69;
  --ap-primary-light: #52adc8;
  --ap-text: #3a4145;
  --ap-text-light: #6f797d;
  --ap-border: #e6e6e6;
  --ap-bg: #ffffff;
  --ap-bg-alt: #f7f8f9;
  --ap-sans: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ap-serif: Georgia, Times, serif;
  --ap-max-width: 1180px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ font-size: 16px; }

body{
  margin: 0;
  font-family: var(--ap-sans);
  color: var(--ap-text);
  background: var(--ap-bg);
  line-height: 1.6;
}

a{ color: var(--ap-primary); text-decoration: none; }
a:hover{ color: var(--ap-primary-dark); text-decoration: underline; }

img{ max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6{
  font-family: var(--ap-sans);
  font-weight: 700;
  line-height: 1.3;
  color: #222;
  margin: 1.4em 0 0.5em;
}
h1{ font-size: 2em; }
h2{ font-size: 1.6em; border-bottom: 1px solid var(--ap-border); padding-bottom: 0.3em; }
h3{ font-size: 1.3em; }
h4{ font-size: 1.1em; }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.ap-wrap{
  max-width: var(--ap-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.ap-page{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding: 40px 0 64px;
}

@media (max-width: 800px){
  .ap-page{ grid-template-columns: 1fr; }
}

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.ap-masthead{
  border-bottom: 1px solid var(--ap-border);
  background: var(--ap-bg);
}
.ap-masthead-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.ap-site-title{
  font-size: 1.3rem;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.01em;
}
.ap-site-title a{ color: #222; }
.ap-site-title a:hover{ text-decoration: none; color: var(--ap-primary); }

.ap-nav ul{
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.ap-nav a{
  display: inline-block;
  padding: 8px 12px;
  color: var(--ap-text);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 4px;
}
.ap-nav a:hover{ background: var(--ap-bg-alt); color: var(--ap-primary); text-decoration: none; }
.ap-nav .current-menu-item a{ color: var(--ap-primary); }

.ap-nav-toggle{
  display: none;
  background: none;
  border: 1px solid var(--ap-border);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
}
@media (max-width: 700px){
  .ap-nav-toggle{ display: block; }
  .ap-nav{ display: none; width: 100%; }
  .ap-nav.is-open{ display: block; }
  .ap-nav ul{ flex-direction: column; }
  .ap-masthead-inner{ flex-wrap: wrap; }
}

/* ==========================================================================
   SIDEBAR / AUTHOR PROFILE
   ========================================================================== */
.ap-sidebar{ text-align: center; }
.ap-author-photo{
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--ap-bg-alt);
}
.ap-author-name{
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 2px;
}
.ap-author-tagline{
  color: var(--ap-text-light);
  font-size: 0.9rem;
  margin: 0 0 14px;
}
.ap-author-bio{
  font-size: 0.9rem;
  color: var(--ap-text-light);
  text-align: left;
  margin-bottom: 18px;
}
.ap-author-links{
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}
.ap-author-links li{
  border-top: 1px solid var(--ap-border);
  padding: 8px 0;
  font-size: 0.88rem;
}
.ap-author-links li:first-child{ border-top: none; }
.ap-author-links a{ color: var(--ap-text); }
.ap-author-links a:hover{ color: var(--ap-primary); }
.ap-author-links .ap-icon{
  display: inline-block;
  width: 18px;
  color: var(--ap-primary);
  font-weight: 700;
}

/* ==========================================================================
   CONTENT / ARCHIVE LISTS
   ========================================================================== */
.ap-content{ min-width: 0; }

.ap-entry-list{ list-style: none; margin: 0; padding: 0; }
.ap-entry{
  padding: 20px 0;
  border-bottom: 1px solid var(--ap-border);
}
.ap-entry:first-child{ padding-top: 0; }
.ap-entry-title{ margin: 0 0 6px; font-size: 1.15rem; }
.ap-entry-title a{ color: #222; }
.ap-entry-title a:hover{ color: var(--ap-primary); }
.ap-entry-meta{
  color: var(--ap-text-light);
  font-size: 0.85rem;
  margin: 0 0 8px;
}
.ap-entry-excerpt{ font-size: 0.95rem; color: var(--ap-text); }
.ap-entry-links a{
  display: inline-block;
  margin-right: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ap-badge{
  display: inline-block;
  background: var(--ap-bg-alt);
  color: var(--ap-primary);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

/* Single publication/talk meta box */
.ap-meta-box{
  background: var(--ap-bg-alt);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
}
.ap-meta-box dt{ font-weight: 700; float: left; width: 110px; clear: left; color: var(--ap-text-light); }
.ap-meta-box dd{ margin: 0 0 6px 110px; }

/* Buttons */
.ap-btn{
  display: inline-block;
  padding: 8px 16px;
  background: var(--ap-primary);
  color: #fff !important;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none !important;
  margin: 4px 6px 4px 0;
}
.ap-btn:hover{ background: var(--ap-primary-dark); }

/* CV page */
.ap-cv h2{ color: var(--ap-primary); }
.ap-cv .ap-cv-section{ margin-bottom: 2em; }

/* Pagination */
.ap-pagination{ margin-top: 30px; text-align: center; }
.ap-pagination a, .ap-pagination span{
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--ap-border);
  border-radius: 4px;
  margin: 0 4px;
  font-size: 0.85rem;
}
.ap-pagination .current{ background: var(--ap-primary); color: #fff; border-color: var(--ap-primary); }

/* Footer */
.ap-footer{
  border-top: 1px solid var(--ap-border);
  padding: 24px 0;
  text-align: center;
  color: var(--ap-text-light);
  font-size: 0.85rem;
}

/* Front page hero (about-style) */
.ap-hero{ padding-top: 8px; }
.ap-hero .ap-entry-list{ margin-top: 24px; }

/* Widget area (footer widgets, optional) */
.ap-widgets{ margin-top: 30px; }
