/*
Theme Name: Shahin Kaveh Academic Portfolio
Theme URI: https://shahinkaveh.com
Author: Shahin Kaveh
Author URI: https://shahinkaveh.com
Description: A custom WordPress theme for Shahin Kaveh's academic portfolio website
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shahinkaveh
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, portfolio, academic
*/

/* ===== CSS Variables ===== */
:root {
  --color-primary: #2d3436;
  --color-primary-light: #636e72;
  --color-accent: #e17055;
  --color-accent-light: #fab1a0;
  --color-bg: #fefefe;
  --color-bg-alt: #f8f9fa;
  --color-bg-dark: #2d3436;
  --color-text: #2d3436;
  --color-text-light: #636e72;
  --color-white: #ffffff;
  --color-border: #dfe6e9;
  
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  
  --transition: all 0.3s ease;
  --max-width: 1100px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-primary);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-primary);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: 1rem;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Header ===== */
header.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Navigation */
.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  font-weight: 600;
  color: var(--color-text-light);
  padding: 0.5rem 0;
  position: relative;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after,
.main-navigation .current_page_item a::after {
  width: 100%;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a,
.main-navigation .current_page_item a {
  color: var(--color-primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
}

.menu-toggle span {
  width: 25px;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  display: block;
}

/* ===== Hero Section ===== */
.hero {
  background: url('images/hero-bg.jpg') center center / cover no-repeat;
  color: var(--color-white);
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(45, 52, 54, 0.7) 0%, rgba(99, 110, 114, 0.6) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-text h1 {
  color: var(--color-white);
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.hero-text .subtitle {
  color: var(--color-accent-light);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero-text p {
  opacity: 0.9;
  max-width: 500px;
}

.hero-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.hero-links .btn-primary,
.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}

.hero-links .btn-primary:hover,
.btn-primary:hover {
  background: var(--color-accent-light);
  color: var(--color-primary);
}

.hero-links .btn-secondary,
.btn-secondary {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}

.hero-links .btn-secondary:hover,
.btn-secondary:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

/* ===== Sections ===== */
section {
  padding: 4rem 0;
}

.section-title {
  margin-bottom: 2rem;
}

.section-title h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--color-accent);
}

/* ===== About Section ===== */
.about {
  background: var(--color-white);
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.about-text p {
  color: var(--color-text-light);
}

.about-sidebar {
  background: var(--color-bg-alt);
  padding: 1.5rem;
  border-radius: 8px;
}

.about-sidebar h4 {
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.about-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-sidebar li {
  padding: 0.5rem 0;
  color: var(--color-text-light);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--color-border);
}

.about-sidebar li:last-child {
  border-bottom: none;
}

/* ===== CV/Work Section ===== */
.cv-section {
  background: var(--color-bg-alt);
}

.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.cv-card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-left: 4px solid var(--color-accent);
}

.cv-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.cv-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.cv-card .date {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.cv-card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ===== Research Section ===== */
.research {
  background: var(--color-white);
}

.research-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.research-item {
  padding: 2rem;
  background: var(--color-white);
  border-radius: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-accent);
}

.research-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.research-item h3,
.research-item h4 {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.research-item .meta {
  font-size: 0.9rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.research-item p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.research-item img {
  transition: var(--transition);
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.research-item img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.research-item .research-content-grid {
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.research-item .research-content-grid img {
  float: right;
  max-width: 35%;
  margin: 0 0 1rem 2rem;
}

.research-item .research-content-grid.img-left img {
  float: left;
  margin: 0 2rem 1rem 0;
}

/* Video Thumbnail */
.video-thumbnail {
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 16 / 9;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
}

.video-thumbnail:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.video-thumbnail:hover .video-play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.video-play-overlay svg {
  width: 35px;
  height: 35px;
  margin-left: 4px;
}

/* Video Thumbnail inside research-content-grid */
.research-item .research-content-grid .video-thumbnail {
  float: right;
  width: 35%;
  max-width: 35%;
  margin: 0 0 1rem 2rem;
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 16 / 9;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}

.research-item .research-content-grid.img-left .video-thumbnail {
  float: left;
  margin: 0 2rem 1rem 0;
}

.research-item .research-content-grid .video-thumbnail:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.research-item .research-content-grid .video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
}

.research-item .research-content-grid .video-thumbnail .video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.research-item .research-content-grid .video-thumbnail:hover .video-play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.research-item .research-content-grid .video-thumbnail .video-play-overlay svg {
  width: 35px;
  height: 35px;
  margin-left: 4px;
}

/* Video Modal */
.video-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
}

.video-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.video-modal-close:hover {
  color: var(--color-accent);
}

.video-modal-iframe-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-modal-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

/* ===== Contact Section ===== */
.contact {
  background: var(--color-bg-dark);
  color: var(--color-white);
}

.contact h2 {
  color: var(--color-white);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info p {
  color: rgba(255,255,255,0.8);
}

.contact-links {
  margin-top: 1.5rem;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--color-white);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.contact-links a:hover {
  color: var(--color-accent-light);
}

.contact-links .icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Contact Form */
.contact-form {
  background: rgba(255,255,255,0.05);
  padding: 2rem;
  border-radius: 8px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255,255,255,0.5);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255,255,255,0.15);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* ===== Footer ===== */
footer.site-footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 2rem 0;
  text-align: center;
  margin-top: auto;
}

footer.site-footer p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin: 0;
}

footer.site-footer a {
  color: var(--color-accent-light);
}

/* ===== Page Specific Styles ===== */
.page-header {
  background: var(--color-bg-dark);
  color: var(--color-white);
  padding: 3rem 2rem;
}

.page-header h1 {
  color: var(--color-white);
  margin-bottom: 0.5rem;
}

.page-header p {
  opacity: 0.8;
  margin: 0;
}

.page-content {
  padding: 3rem 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
  .hero-content {
    text-align: center;
    align-items: center;
  }
  
  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-links {
    justify-content: center;
  }
  
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  .hero-text h1 {
    font-size: 2.25rem;
  }
  
  .hero {
    padding: 3rem 1.5rem;
  }
  
  .main-navigation ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--color-border);
  }
  
  .main-navigation ul.active {
    display: flex;
  }
  
  .main-navigation li {
    border-bottom: 1px solid var(--color-border);
  }
  
  .main-navigation li:last-child {
    border-bottom: none;
  }
  
  .main-navigation a {
    display: block;
    padding: 1rem;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  section {
    padding: 2.5rem 0;
  }
  
  .research-item .research-content-grid img,
  .research-item .research-content-grid.img-left img {
    float: none;
    max-width: 100%;
    margin: 0 0 1.5rem 0;
    display: block;
  }
  
  .research-item .research-content-grid .video-thumbnail {
    float: none;
    max-width: 100%;
    margin: 0 0 1.5rem 0;
    display: block;
    width: 100%;
  }
  
  .research-item .research-content-grid.img-left .video-thumbnail {
    margin: 0 0 1.5rem 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .header-inner {
    padding: 1rem;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
  
  .research-item {
    padding: 1.5rem;
  }
}

/* WordPress specific */
.wp-block-image img {
  max-width: 100%;
  height: auto;
}

.aligncenter {
  text-align: center;
}

.alignleft {
  float: left;
  margin-right: 1.5rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
