/*
Theme Name: Inwestowanie Algorytmiczne
Theme URI: https://inwestowaniealgorytmiczne.pl
Author: Grzegorz Link
Author URI: https://grzegorz.link
Description: A custom WordPress theme for Inwestowanie Algorytmiczne blog focusing on algorithmic investing
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: inwestowanie-algorytmiczne
Tags: blog, three-columns, custom-header, custom-menu, featured-images
*/

/* CSS Variables */
:root {
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --color-primary: #667eea;
  --color-primary-dark: #764ba2;
  --color-text: #1f2937;
  --color-text-light: #374151;
  --color-text-muted: #6b7280;
  --color-text-lighter: #9ca3af;
  --color-header-border: #e5e7eb;
  --color-border: #ffffff;
  --color-bg-light: #f3f4f6;
  --sidebar-width: 250px;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Body */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-header-border);
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 2rem;
  align-items: center;
}

.header-text {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  width: 80px;
  height: auto;
}

header h1 {
  font-size: 1.125rem;
  font-weight: 700;
  white-space: nowrap;
}

header h1 a {
  text-decoration: none;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
.main-nav .nav-content {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-nav ul,
.main-nav .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.main-nav li,
.main-nav .menu-item {
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav li::before,
.main-nav .menu-item::before {
  content: none;
  display: none;
}

.main-nav a {
  text-decoration: none;
  color: var(--color-text-light);
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--color-primary);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s;
}

.main-nav a:hover::after {
  width: 100%;
}

/* Main Layout - Three Column Grid */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.625rem 2rem 2rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: 2rem;
  align-items: start;
}

.center-content {
  min-width: 0;
}

.right-sidebar {
  position: sticky;
  top: 70px;
  height: fit-content;
}

/* Footer */
footer {
  background: var(--color-bg-light);
  color: var(--color-text-light);
  padding: 3rem 0 2rem;
  margin-top: 3rem;
  border-radius: 40px 40px 0 0;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: 2rem;
  align-items: start;
}

.newsletter-container {
  grid-column: 2;
}

.newsletter-container h2 {
  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.newsletter-container h2 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.newsletter-container p {
  color: var(--color-text-light);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.newsletter-form input[type="email"] {
  flex: 1;
  max-width: 300px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-primary);
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--color-text-muted);
}

.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: var(--gradient);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.newsletter-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.newsletter-container small {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.footer-links {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: right;
}

.footer-links ul,
.footer-links .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links li,
.footer-links .menu-item {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: right;
}

.footer-links li::before,
.footer-links .menu-item::before {
  content: none;
  display: none;
}

.footer-links a {
  color: var(--color-text-light);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.copyright {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: 2rem 2rem 0;
  border-top: 1px solid var(--color-header-border);
}

/* Image Container */
.image-container {
  width: 100%;
  margin: 2rem 0;
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Article Image Placeholders (for homepage) */
.article-image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.article-image-placeholder:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.article-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-image-placeholder.empty {
  background: transparent;
  cursor: auto;
  visibility: hidden;
}

.article-image-placeholder.empty:hover {
  box-shadow: none;
  transform: none;
}

/* Homepage specific layout for large screens */
@media (min-width: 1101px) {
  .home .left-sidebar {
    display: none;
  }
  
  .home .center-content {
    grid-column: 1 / 3;
  }
  
  .article-with-image {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 2rem;
    align-items: start;
  }
  
  .article-with-image .article-image-placeholder {
    margin-top: 1.75rem;
  }
  
  .home .right-sidebar {
    grid-column: 3;
  }
}

/* Articles Section */
.articles-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.articles-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

/* Article Cards */
.article-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.article-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  transform: translateY(-2px);
}

.article-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.article-title a {
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.2s;
}

.article-title a:hover {
  color: var(--color-primary);
}

.article-excerpt {
  color: #4b5563;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.article-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.article-date,
.article-footer .comments {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.article-footer a {
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 500;
  transition: color 0.2s;
}

.article-footer a:hover {
  color: var(--color-primary-dark);
}

.article-footer .comments a {
  color: inherit;
  font-weight: normal;
}

.article-footer .comments a:hover {
  color: var(--color-text);
}

/* Profile Card */
.profile-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0 1rem 1rem;
  text-align: center;
}

.profile-photo {
  width: 180px;
  height: 135px;
  margin: 0 auto 1rem;
  border: 4px solid var(--color-bg-light);
}
  
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-bio {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.profile-bio a,
.profile-links a {
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 500;
  transition: color 0.2s;
}

.profile-bio a:hover,
.profile-links a:hover {
  color: var(--color-primary-dark);
}

.profile-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Responsive - Tablet */
@media (max-width: 1100px) {
  main {
    grid-template-columns: 1fr var(--sidebar-width);
  }
  
  .left-sidebar {
    display: none;
  }
  
  .article-image-placeholder.empty {
    display: none;
  }
  
  .article-card {
    padding: 1.25rem 0.5rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr var(--sidebar-width);
  }
  
  .newsletter-container {
    grid-column: 1;
  }
  
  .footer-links {
    grid-column: 2;
  }
}

/* Responsive - Mobile */
@media (max-width: 900px) {
  .header-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .logo-link {
    order: -1;
    justify-self: center;
  }
  
  .header-text {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  header h1 {
    white-space: normal;
  }
  
  .main-nav .nav-content {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .main-nav a {
    font-size: 0.8125rem;
  }
  
  main {
    grid-template-columns: 1fr;
    padding: 0.625rem 1.5rem 2rem;
  }
  
  .right-sidebar {
    position: relative;
    top: 0;
    order: -1;
  }
  
  .article-image-placeholder.empty {
    display: none;
  }
  
  .article-card {
    padding: 1.25rem 0rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .newsletter-container,
  .footer-links {
    grid-column: 1;
  }
  
  .footer-links {
    align-items: center;
    text-align: center;
  }

  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-form input[type="email"] {
    max-width: 100%;
  }

  .newsletter-form button {
    width: 100%;
  }
  
  .profile-photo {
    width: 200px;
    height: 150px;
  }
}

/* WordPress specific styles */
.wp-post-image {
  max-width: 100%;
  height: auto;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.aligncenter {
  display: block;
  margin: 2rem auto;
}

.alignleft {
  float: left;
  margin: 0 1.5rem 1.5rem 0;
}

.alignright {
  float: right;
  margin: 0 0 1.5rem 1.5rem;
}

/* WordPress Blocks Support */
.wp-block-image {
  margin: 2rem 0;
}

.wp-block-image img {
  max-width: 100%;
  height: auto;
}

figcaption,
.wp-caption-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* Hide logo on homepage in tablet range when viewport is short */
@media (max-width: 1100px) and (max-height: 480px) {
  .header-content {
    grid-template-columns: 1fr;
  }
  
  .logo-link {
    display: none;
  }
}
