/* Lohusuu Kool – Complete CSS */

:root {
  --brand: #0b6aa2;
  --brand-dark: #084e78;
  --accent: #f5b301;
  --bg: #f7fafc;
  --text: #0f172a;
  --muted: #6b7280;
  --white: #ffffff;
  --surface: #ffffff;
  --ring: rgba(11,106,162,0.15);
  --radius: 12px;
  --pill: 44px;
}

/* === GLOBAL STYLES === */
html, body {
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* === ICONS === */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: middle;
}

/* === NOTICE BAR === */
.notice-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0b6aa2;
  color: #fff;
  padding: 8px 0;
  font-size: 14px;
}

.notice-bar .container {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.notice-bar button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 10px;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}

.notice-bar button:hover {
  background: rgba(255,255,255,0.25);
}

.notice-bar .icon {
  width: 18px;
  height: 18px;
}

/* === FOCUS STATES === */
.search input:focus,
.lang-switch:focus,
.cta:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

/* Alternatiivne lühendatud tekst väikestele ekraanidele */
@media (max-width: 380px) {
  .cta .cta-text-full {
    display: none;
  }

  .cta .cta-text-short {
    display: inline;
  }
}

@media (min-width: 381px) {
  .cta .cta-text-full {
    display: inline;
  }

  .cta .cta-text-short {
    display: none;
  }
}

/* === FORCED MARGINS === */
#page-container {
  padding-top: 0 !important;
}

.admin-bar #page-container {
  padding-top: 0 !important;
}

body:not(.et-tb) #main-content .container,
body:not(.et-tb-has-header) #main-content .container {
  padding-top: 0 !important;
}

.et_pb_section {
  margin-top: 0 !important;
}

/* === CONTENT SECTIONS LAYOUT === */
.lhk-content-sections {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin: 55px 0 2rem 0 !important;
  padding: 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 30%, #e2e8f0 70%, #f8fafc 100%);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* === SECTIONS === */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
  color: #111827;
}

/* === NOTICES === */
.lhk-notices {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  margin: 0rem 0;
}

.lhk-notices .section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #111827;
}

.lhk-notices__inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Paranda wpautop probleemid */
.lhk-notices__inner p:empty,
.notice-card p:empty,
.lhk-notices__inner br,
.lhk-notices p:empty,
.lhk-notices br {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.notice-card {
  display: block !important;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  transition: all 0.15s ease;
  text-decoration: none;
}

.notice-card:hover {
  border-color: #0073aa;
  box-shadow: 0 2px 6px rgba(0,115,170,0.08);
  text-decoration: none;
  transform: translateY(-1px);
}

.notice-link {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  color: inherit;
  text-decoration: none;
  min-height: 50px;
}

.notice-link:hover {
  color: inherit;
  text-decoration: none;
}

/* Tunnuspilt */
.notice-thumb {
  flex-shrink: 0;
  width: 45px;
  height: 45px;
  border-radius: 4px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notice-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.notice-card:hover .notice-thumb img {
  transform: scale(1.05);
}

.notice-thumb:empty::before {
  content: "📄";
  font-size: 1.2rem;
  opacity: 0.4;
}

/* Sisu */
.notice-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notice-date {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
  min-width: 70px;
}

.date-icon {
  color: #9ca3af;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.notice-title {
  font-weight: 500;
  color: #1f2937;
  line-height: 1.3;
  flex: 1;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grid layout */
.layout-grid .lhk-notices__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

.layout-grid .notice-link {
  flex-direction: row !important;
  align-items: center;
  text-align: left;
  padding: 0.75rem;
  min-height: 50px;
}

.layout-grid .notice-thumb {
  width: 45px;
  height: 45px;
}

.layout-grid .notice-content {
  flex-direction: row;
  align-items: center;
  text-align: left;
}

.layout-grid .notice-title {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* === QUICK LINKS === */
.lhk-quick-links {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}

.lhk-quick-links .section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #111827;
}

.lhk-quick-links__grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: #374151;
  transition: all 0.2s;
}

.quick-link-item:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-decoration: none;
  color: #374151;
}

.quick-link-item .icon {
  width: 16px;
  height: 16px;
  color: #2563eb;
  flex-shrink: 0;
}

.quick-link-item .title {
  font-weight: 500;
  font-size: 14px;
}

/* Mobiilis veelgi väiksemad ikoonid */
@media (max-width: 768px) {
  .quick-link-item .icon {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .quick-link-item .icon {
    width: 12px;
    height: 12px;
  }
}

/* === LOAD MORE BUTTON === */
.lhk-notices__load-more {
  margin-top: 1.5rem;
  text-align: center;
}

.lhk-load-more-btn {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lhk-load-more-btn:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.lhk-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lhk-load-more-btn .btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lhk-load-more-btn .icon.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === FOOTER === */
.site-footer {
  background: #111827;
  color: #d1d5db;
  margin-top: 60px;
}

.footer-main {
  padding: 40px 0;
}

.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 2fr 1fr 1fr;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-brand .logo-mark {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.footer-brand .brand-name {
  color: white;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.footer-tagline {
  font-weight: 600;
  color: #e5e7eb;
  margin: 0 0 12px 0;
}

.footer-description {
  margin: 0;
  line-height: 1.6;
}

.footer-section h4 {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #d1d5db;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #2563eb;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.contact-item .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: #6b7280;
}

.contact-item .content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-item .label {
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  font-weight: 500;
}

.contact-item .value {
  color: #d1d5db;
  text-decoration: none;
}

.contact-item .value:hover {
  color: #2563eb;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding: 20px 0;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  margin: 0;
  font-size: 14px;
}

.footer-links-bottom {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links-bottom a {
  font-size: 14px;
  color: #d1d5db;
  text-decoration: none;
}

.footer-links-bottom a:hover {
  color: #2563eb;
}

/* === MODAL === */
.lhk-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lhk-modal[hidden] {
  display: none;
}

.lhk-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.75);
  cursor: pointer;
}

.lhk-modal__dialog {
  position: relative;
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.lhk-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  z-index: 1;
  transition: background-color 0.2s ease;
}

.lhk-modal__close:hover {
  background: rgba(0,0,0,0.2);
}

.lhk-modal__content {
  padding: 2rem;
}

.lhk-modal__loader {
  width: 48px;
  height: 48px;
  margin: 40px auto;
  border-radius: 50%;
  border: 4px solid #e5e7eb;
  border-top-color: var(--brand);
  animation: lhkspin 1s linear infinite;
}

@keyframes lhkspin {
  to { transform: rotate(360deg); }
}

/* === RESPONSIVE CONTENT === */
@media (max-width: 768px) {
  .lhk-content-sections {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .notice-link {
    padding: 0.6rem;
    gap: 0.6rem;
    min-height: 45px;
  }

  .notice-thumb {
    width: 40px;
    height: 40px;
  }

  .notice-title {
    font-size: 0.9rem;
  }

  .notice-date {
    font-size: 0.75rem;
    min-width: 60px;
  }

  .date-icon {
    width: 12px;
    height: 12px;
  }

  .layout-grid .lhk-notices__inner {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .lhk-content-sections {
    padding: 1rem;
  }

  .lhk-notices,
  .lhk-quick-links {
    padding: 1rem;
  }

  .notice-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .notice-date {
    min-width: auto;
    order: -1;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .notice-title {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }
}

/* === GRID LAYOUT FIX - teated ja kiirlingid sama kõrgusega === */

/* Grid container */
.lhk-content-sections {
  display: grid !important;
  grid-template-columns: 1fr 300px !important;
  gap: 2rem !important;
  align-items: stretch !important;
}

/* Sektsioonid - sama kõrgus */
.lhk-notices,
.lhk-quick-links {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 400px !important;
}

/* Sisu võtab kogu vaba ruumi */
.lhk-notices__inner,
.lhk-quick-links__grid {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Responsive - mobiilis üks veerg */
@media (max-width: 768px) {
  .lhk-content-sections {
    grid-template-columns: 1fr !important;
  }

  .lhk-notices,
  .lhk-quick-links {
    min-height: auto !important;
  }
}

/* === SLAIDER MOBIILIS - ei jää päise alla === */
@media (max-width: 768px) {
  .lhk-slider-section {
    margin-top: 80px !important;
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 560px) {
  .lhk-slider-section {
    margin-top: 70px !important;
  }
}

@media (max-width: 420px) {
  .lhk-slider-section {
    margin-top: 65px !important;
  }
}

/* Admin bar olemas - lisa lisaruumi */
.admin-bar .lhk-slider-section {
  margin-top: 32px !important;
}

@media screen and (max-width: 782px) {
  .admin-bar .lhk-slider-section {
    margin-top: 126px !important;
  }
}

@media screen and (max-width: 560px) {
  .admin-bar .lhk-slider-section {
    margin-top: 116px !important;
  }
}

@media screen and (max-width: 420px) {
  .admin-bar .lhk-slider-section {
    margin-top: 111px !important;
  }
}

/* Sticky header jaoks - dünaamiline tuvastamine */
.site-header.sticky + .lhk-slider-section,
.site-header[data-sticky="true"] + .lhk-slider-section {
  margin-top: 80px !important;
}

/* Kui slaider on otse body sees (fallback automaatne) */
body > .lhk-slider-section {
  margin-top: 80px !important;
}

@media (max-width: 560px) {
  body > .lhk-slider-section {
    margin-top: 70px !important;
  }
}

@media (max-width: 420px) {
  body > .lhk-slider-section {
    margin-top: 65px !important;
  }
}
