/* ===================================
   TORFOS - Institutional Knowledge Portal
   Color Palette:
   Primary: #2E4057
   Secondary: #E6EAEF
   Accent 1: #A7C5D8
   Accent 2: #D3A74C
   =================================== */

/* ROOT & VARIABLES */
:root {
  --primary: #2E4057;
  --secondary: #E6EAEF;
  --accent-1: #A7C5D8;
  --accent-2: #D3A74C;
  --white: #FFFFFF;
  --light-gray: #F5F7FB;
  --medium-gray: #D0D8E0;
  --dark-gray: #6B7A8F;
  --spacing-unit: 8px;
  --max-width: 1440px;
  --transition: 0.8s ease-out;
}

/* RESET & GLOBAL STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--primary);
  background-color: var(--white);
  font-size: 16px;
}

/* TYPOGRAPHY */
h1 {
  font-family: 'Montserrat', 'Raleway', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  letter-spacing: 0.5px;
  margin-bottom: calc(var(--spacing-unit) * 6);
  text-transform: none;
}

h2 {
  font-family: 'Montserrat', 'Raleway', sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--accent-1);
  line-height: 1.3;
  letter-spacing: 0.3px;
  margin-bottom: calc(var(--spacing-unit) * 4);
}

h3 {
  font-family: 'Montserrat', 'Raleway', sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: calc(var(--spacing-unit) * 3);
}

h4 {
  font-family: 'Montserrat', 'Raleway', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--primary);
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

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

strong {
  font-weight: 700;
  color: var(--primary);
}

em {
  font-style: italic;
  color: var(--dark-gray);
}

/* CONTAINERS */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 4);
}

.container-full {
  width: 100%;
}

section {
  padding: calc(var(--spacing-unit) * 12) 0;
  position: relative;
}

section.section-alternate {
  background-color: var(--secondary);
}

section.section-light {
  background-color: var(--light-gray);
}

/* HEADER & NAVIGATION */
header {
  background-color: var(--white);
  border-bottom: 1px solid var(--medium-gray);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--spacing-unit) * 2) 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: calc(var(--spacing-unit) * 4);
  padding-right: calc(var(--spacing-unit) * 4);
}

.logo {
  font-family: 'Montserrat', 'Raleway', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

nav ul {
  display: flex;
  list-style: none;
  gap: calc(var(--spacing-unit) * 4);
}

nav a {
  font-family: 'Montserrat', 'Raleway', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: var(--accent-1);
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-1);
}

/* FOOTER */
footer {
  background-color: var(--primary);
  color: var(--secondary);
  padding: calc(var(--spacing-unit) * 10) 0 calc(var(--spacing-unit) * 4);
  margin-top: calc(var(--spacing-unit) * 16);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 4);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--spacing-unit) * 6);
}

.footer-section h4 {
  color: var(--accent-2);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.footer-section a {
  color: var(--secondary);
  display: block;
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.footer-section a:hover {
  color: var(--accent-1);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 4);
  border-top: 1px solid rgba(230, 234, 239, 0.2);
  text-align: center;
  color: var(--secondary);
  font-size: 0.875rem;
  margin-top: calc(var(--spacing-unit) * 6);
}

/* BUTTONS */
.btn {
  display: inline-block;
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 4);
  background-color: var(--accent-1);
  color: var(--white);
  border: 2px solid var(--accent-1);
  font-family: 'Montserrat', 'Raleway', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  letter-spacing: 0.5px;
  border-radius: 0;
}

.btn:hover {
  background-color: transparent;
  color: var(--accent-1);
  box-shadow: 0 4px 12px rgba(167, 197, 216, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent-1);
  border: 2px solid var(--accent-1);
}

.btn-secondary:hover {
  background-color: var(--accent-1);
  color: var(--white);
}

/* HERO SECTIONS */
.hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(46, 64, 87, 0.85) 0%, rgba(46, 64, 87, 0.7) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero h1 {
  color: var(--secondary);
  font-size: 4rem;
  margin-bottom: calc(var(--spacing-unit) * 3);
  animation: fadeInUp 1s ease-out;
}

.hero p {
  color: var(--light-gray);
  font-size: 1.25rem;
  max-width: 600px;
  animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* TWO-COLUMN LAYOUTS */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-unit) * 8);
  align-items: center;
}

.two-column.reverse {
  direction: rtl;
}

.two-column.reverse > * {
  direction: ltr;
}

.column-content {
  animation: fadeIn 0.8s ease-out;
}

.column-image {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(46, 64, 87, 0.15);
}

.column-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.8s ease;
}

.column-image:hover img {
  transform: scale(1.02);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* CARDS */
.card {
  background-color: var(--white);
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  padding: calc(var(--spacing-unit) * 4);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--spacing-unit) * 6);
  margin-top: calc(var(--spacing-unit) * 4);
}

.card h3 {
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--primary);
}

.card p {
  font-size: 0.95rem;
  color: var(--dark-gray);
  margin-bottom: 0;
}

/* LISTS */
ul, ol {
  margin-left: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

li {
  margin-bottom: calc(var(--spacing-unit) * 1.5);
  color: var(--primary);
}

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

figure {
  margin-bottom: calc(var(--spacing-unit) * 6);
}

figcaption {
  font-size: 0.85rem;
  color: var(--dark-gray);
  margin-top: calc(var(--spacing-unit) * 1.5);
  font-style: italic;
}

/* ACCENT TEXT */
.accent {
  color: var(--accent-2);
  font-weight: 700;
}

.highlight {
  background-color: rgba(211, 167, 76, 0.1);
  padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
  border-left: 4px solid var(--accent-2);
  padding-left: calc(var(--spacing-unit) * 2);
}

/* FORMS */
.form-group {
  margin-bottom: calc(var(--spacing-unit) * 4);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 1);
  color: var(--primary);
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: calc(var(--spacing-unit) * 2);
  border: 1px solid var(--medium-gray);
  border-radius: 0;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(167, 197, 216, 0.1);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .two-column {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 6);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  nav ul {
    gap: calc(var(--spacing-unit) * 2);
  }

  nav a {
    font-size: 0.8rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 calc(var(--spacing-unit) * 2);
  }

  .header-content {
    padding-left: calc(var(--spacing-unit) * 2);
    padding-right: calc(var(--spacing-unit) * 2);
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  nav ul {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
  }

  section {
    padding: calc(var(--spacing-unit) * 6) 0;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 4);
  }
}
