/* Custom styles for personal website */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #2c3e50;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    
/* Font Variables */
    --font-primary: 'Inter', sans-serif;           /* Peamine font (body tekst) */
    --font-headings: 'Playfair Display', serif;    /* Pealkirjad */
    --font-brand: 'Dancing Script', cursive;       /* Brändi font (hero h1) */
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    /* Mobile pull-to-refresh support */
    touch-action: auto;
    user-select: auto;
}

html {
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    touch-action: auto;
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    font-weight: 600;
}

.hero-section {
    background-image: url('/images/background/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: white;
    padding: 120px 0;
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

/* Overlay for better text readability */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-family: var(--font-brand);
    font-weight: 400;
    font-size: 6rem;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.hero-section .lead {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 30px;
    letter-spacing: 0.01em;
}

.hero-section .btn {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 25px;
}

/* Navigation */
.navbar-brand {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    color: #222;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color) !important;
}

.navbar-nav .nav-link.active {
    color: var(--secondary-color) !important;
    font-weight: 700;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Badges */
.badge {
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 15px;
}

.badge.bg-secondary.text-decoration-none:hover {
    background-color: var(--secondary-color) !important;
    color: #fff !important;
    cursor: pointer;
    text-decoration: none;
}

/* Buttons */
.btn {
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Sections */
section {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--light-bg) !important;
}

/* Footer */
footer {
    background-color: var(--dark-bg) !important;
}

footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary-color) !important;
}

footer {
    margin-top: 2em;
  }

/* Blog posts */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.blog-post h1, .blog-post h2, .blog-post h3 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Blog and Bio pages header */
.blog-page-wrapper h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.blog-post p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.blog-post ul, .blog-post ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.blog-post li {
    margin-bottom: 8px;
}

/* Research */
.research-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.research-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .hero-section {
        padding: 100px 0;
        min-height: 90vh;
    }
    
    .hero-section h1 {
        font-size: 5rem;
    }
    
    .hero-section .lead {
        font-size: 2.3rem;
    }
}

@media (max-width: 992px) {
    .hero-section {
        padding: 80px 0;
        min-height: 80vh;
    }
    
    .hero-section h1 {
        font-size: 4rem;
    }
    
    .hero-section .lead {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        min-height: 70vh;
        background-attachment: scroll; /* Fix mobile parallax issues */
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .hero-section .lead {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 40px 0;
        min-height: 60vh;
    }
    
    .hero-section h1 {
        font-size: 3rem;
        margin-bottom: 15px;
    }
    
    .hero-section .lead {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
}

@media (max-width: 420px) {
    .hero-section h1 {
        font-size: 4rem;
    }
    
    .hero-section .lead {
        font-size: 1.7rem;
    }
}

/* Focus styles for accessibility */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}
.nav-link:focus {
    box-shadow: none;
    outline: none;
}

/* Print styles */
@media print {
    .navbar, .footer, .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Bio container */
.bio-container {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 19px;
  color: #000000;
}

.bio-container p {
  margin-bottom: 1.5em;
}

.bio-container hr {
  margin-bottom: 0.5em;
}

/* Skills accordion */
.skills-accordion {
  margin-top: 0.1em;
  padding-top: 0;
  position: relative;
  z-index: 3;
  color: #000000;
}

.skills-accordion summary {
  margin-top: 0;
  padding-top: 0.2em;
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  padding: 0.5em 0;
  margin-bottom: 0;
  color: #000000;
}

.skills-accordion ul,
.skills-accordion li,
.skills-accordion h4,
.skills-accordion p {
  color: #000000;
}
.skills-accordion[open] > .container,
.skills-accordion[open] > .row {
  margin-top: 0.5em;
  margin-bottom: 0;
  padding-bottom: 0;
}
.skills-accordion .container,
.skills-accordion .row {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Blog Page Background */
.blog-page-wrapper {
    background-image: url('/images/background/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    position: relative;
}

.blog-page-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.blog-page-wrapper .container {
    position: relative;
    z-index: 2;
}
