/* ============================================
   Tudengitööde Konkurss - Frontend CSS
   Disain: Figma kogu.ee
   ============================================ */

:root {
    --ttk-orange-10:  #fcebda;
    --ttk-orange-20:  #f9e2c7;
    --ttk-orange-40:  #f4c58f;
    --ttk-orange-100: #ba6c12;
    --ttk-gray-100:   #f7f7f8;
    --ttk-gray-200:   #e9e9ec;
    --ttk-gray-300:   #c8c8d0;
    --ttk-blue-20:    #e3f2fd;
    --ttk-text-primary:   #000000;
    --ttk-text-secondary: #454854;
    --ttk-text-tertiary:  #686b78;
    --ttk-white:      #ffffff;
    --ttk-font:       'Montserrat', sans-serif;
}

/* --- Typography --- */
.ttk-h1 {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.5;
    color: var(--ttk-text-primary);
    margin: 0 0 16px;
}
.ttk-h2 {
    font-family: var(--ttk-font);
    font-weight: 500;
    font-size: 40px;
    line-height: 48px;
    color: var(--ttk-text-primary);
    margin: 0 0 24px;
}

/* --- Buttons --- */
.ttk-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    background: var(--ttk-orange-40);
    color: var(--ttk-text-primary);
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.6;
    padding: 12px 32px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}
.ttk-btn-primary:hover {
    background: var(--ttk-orange-100);
    color: #fff;
    text-decoration: none;
}
.ttk-btn-primary.ttk-btn-full {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}
.ttk-btn-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* ============================================
   LIST VIEW
   ============================================ */
.ttk-list-view {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}
.ttk-page-title { margin: 0; }
.ttk-page-intro {
    font-family: var(--ttk-font);
    font-size: 24px;
    line-height: 1.6;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-page-intro strong { font-weight: 700; }

/* Hero */
.ttk-hero-upcoming {
    display: flex;
    background: var(--ttk-orange-10);
    border-radius: 12px;
    overflow: hidden;
}
.ttk-hero-image {
    width: 520px;
    flex-shrink: 0;
    min-height: 280px;
    position: relative;
}
.ttk-hero-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: none;
}
.ttk-hero-details {
    flex: 1;
    min-width: 0;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}
.ttk-hero-label {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: 2px;
    color: var(--ttk-orange-100);
    margin: 0;
}
.ttk-hero-title {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 24px;
    line-height: 32px;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-hero-intro {
    font-family: var(--ttk-font);
    font-size: 18px;
    line-height: 1.6;
    color: var(--ttk-text-secondary);
    margin: 0;
}
.ttk-hero-date {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ttk-text-primary);
}
.ttk-hero-date svg { flex-shrink: 0; }

/* About */
.ttk-about-section { margin: 0; }
.ttk-about-content {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}
.ttk-about-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ttk-about-body {
    font-family: var(--ttk-font);
    font-size: 16px;
    line-height: 24px;
    color: var(--ttk-text-primary);
}
.ttk-about-body p { margin: 0 0 16px; }
.ttk-about-body p:last-child { margin-bottom: 0; }

/* Organizers */
.ttk-organizers-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ttk-org-label {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 14px;
    color: var(--ttk-text-tertiary);
    margin: 0;
}
.ttk-org-logos {
    display: flex;
    gap: 80px;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--ttk-gray-100);
    border-radius: 8px;
    flex-wrap: wrap;
}
.ttk-org-logo img {
    max-height: 41px;
    width: auto;
}

/* Testimonial */
.ttk-testimonial {
    background: var(--ttk-orange-20);
    border-radius: 8px;
    padding: 32px;
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ttk-testimonial-mark {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.5;
    color: var(--ttk-orange-100);
}
.ttk-testimonial-quote {
    font-family: var(--ttk-font);
    font-size: 18px;
    line-height: 1.6;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-testimonial-author {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: var(--ttk-text-secondary);
    margin: 0;
}

/* Quick facts */
.ttk-quickfacts {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ttk-fact {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px;
    text-align: center;
}
.ttk-fact-value {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 32px;
    line-height: 40px;
    color: #000;
}
.ttk-fact-label {
    font-family: var(--ttk-font);
    font-size: 16px;
    line-height: 24px;
    color: var(--ttk-text-secondary);
}
.ttk-fact-divider {
    width: 1px;
    height: 48px;
    background: var(--ttk-gray-300);
    flex-shrink: 0;
}

/* ============================================
   VÕIDUTÖÖD — 4-veeru grid, kaanepilt peamine
   ============================================ */
.ttk-voitatood-section { display: flex; flex-direction: column; gap: 32px; }
.ttk-voitatood-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.ttk-cover-card {
    background: var(--ttk-gray-100);
    border: 1px solid var(--ttk-gray-200);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px -2px rgba(24,39,75,0.12), 0 4px 4px -2px rgba(24,39,75,0.08);
    text-decoration: none;
    color: inherit;
}
.ttk-cover-card:hover { text-decoration: none; }
.ttk-cover-img {
    aspect-ratio: 272 / 209;
    position: relative;
    overflow: hidden;
    background: #fff;
}
.ttk-cover-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: none;
}
.ttk-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e9e9ec 0%, #c8c8d0 100%);
}
.ttk-cover-data {
    padding: 4px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.ttk-cover-title {
    font-family: var(--ttk-font);
    font-weight: 500;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-cover-author {
    font-family: var(--ttk-font);
    font-size: 14px;
    line-height: 24px;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-cover-publisher {
    font-family: var(--ttk-font);
    font-size: 14px;
    line-height: 24px;
    color: var(--ttk-text-secondary);
    margin: 0;
}

/* ============================================
   INSPIRATSIOONIKS — rida-kirjed
   ============================================ */
.ttk-inspiratsiooniks-section { display: flex; flex-direction: column; gap: 32px; }
.ttk-inspiratsiooniks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ttk-list-item {
    background: var(--ttk-gray-100);
    border: 1px solid var(--ttk-gray-200);
    border-radius: 4px;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 8px;
    overflow: hidden;
    padding: 4px 16px 4px 4px;
    box-shadow: 0 2px 4px -2px rgba(24,39,75,0.12), 0 4px 4px -2px rgba(24,39,75,0.08);
    align-items: center;
}
.ttk-list-item-cover {
    width: 90px;
    height: 69px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.ttk-list-item-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: none;
}
.ttk-list-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e9e9ec 0%, #c8c8d0 100%);
}
.ttk-list-item-data {
    padding: 4px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ttk-list-item-title {
    font-family: var(--ttk-font);
    font-weight: 500;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-list-item-author {
    font-family: var(--ttk-font);
    font-size: 14px;
    line-height: 24px;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-list-item-publisher {
    font-family: var(--ttk-font);
    font-size: 14px;
    line-height: 24px;
    color: var(--ttk-text-secondary);
    margin: 0;
}
.ttk-list-item-year {
    font-family: var(--ttk-font);
    font-size: 14px;
    line-height: 24px;
    color: var(--ttk-text-secondary);
    margin: 0;
}
.ttk-list-item-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.ttk-list-item-link {
    color: var(--ttk-text-tertiary);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.ttk-list-item-link:hover { color: var(--ttk-orange-100); }

/* ============================================
   SINGLE / DETAIL VIEW
   ============================================ */
.ttk-single-wrap { background: #fff; }

.ttk-single-hero {
    padding: 40px 120px 0;
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 1440px;
    margin: 0 auto;
    box-sizing: border-box;
}
.ttk-single-hero-img {
    border-radius: 8px;
    overflow: hidden;
    height: 348px;
    position: relative;
}
.ttk-single-hero-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: none;
}
.ttk-single-hero-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 40px;
    border-bottom: 2px solid var(--ttk-orange-40);
    max-width: 1200px;
    align-self: stretch;
}
.ttk-single-title {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.5;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-single-meta {
    font-family: var(--ttk-font);
    font-size: 18px;
    line-height: 1.6;
    color: var(--ttk-text-primary);
    margin: 0;
}

.ttk-single-main {
    padding: 40px 120px 56px;
    max-width: 1440px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 56px;
}
.ttk-single-content-wrap {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1200px;
}
.ttk-single-primary {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 48px;
}
.ttk-single-description {
    font-family: var(--ttk-font);
    font-size: 24px;
    line-height: 1.6;
    color: var(--ttk-text-primary);
}
.ttk-single-description p { margin: 0 0 16px; }
.ttk-single-description p:last-child { margin-bottom: 0; }
.ttk-single-description h2 {
    font-family: var(--ttk-font);
    font-weight: 500;
    font-size: 40px;
    line-height: 48px;
    margin: 32px 0 16px;
}
.ttk-single-description h3 {
    font-family: var(--ttk-font);
    font-weight: 500;
    font-size: 48px;
    line-height: 1.5;
    margin: 24px 0 16px;
}
.ttk-single-description strong { font-weight: 700; }
.ttk-single-description ul, .ttk-single-description ol {
    margin: 0 0 16px 0;
    padding-left: 1.5em;
}
.ttk-single-description li { margin-bottom: 8px; }

/* Sidebar */
.ttk-single-sidebar {
    width: 373px;
    flex-shrink: 0;
    background: var(--ttk-gray-100);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-sizing: border-box;
}
.ttk-sidebar-section {
    border-bottom: 1px solid var(--ttk-gray-300);
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ttk-sidebar-section:last-child { border-bottom: none; }
.ttk-sidebar-title {
    font-family: var(--ttk-font);
    font-weight: 500;
    font-size: 24px;
    line-height: 32px;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-sidebar-text {
    font-family: var(--ttk-font);
    font-size: 16px;
    line-height: 24px;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-sidebar-value {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 16px;
    color: var(--ttk-text-primary);
    margin: 0;
}
.ttk-past-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #000;
    padding: 24px 16px;
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.6;
    color: #000;
    text-align: center;
    box-sizing: border-box;
}

/* Contact */
.ttk-contact-card {
    display: flex;
    gap: 16px;
    align-items: center;
}
.ttk-contact-photo {
    width: 77px;
    height: 76px;
    border-radius: 24px;
    object-fit: cover;
    flex-shrink: 0;
}
.ttk-contact-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ttk-contact-name { font-family: var(--ttk-font); font-weight: 700; font-size: 18px; line-height: 1.6; color: var(--ttk-text-primary); margin: 0; }
.ttk-contact-title { font-family: var(--ttk-font); font-size: 16px; color: var(--ttk-text-secondary); margin: 0; }
.ttk-contact-email { font-family: var(--ttk-font); font-size: 16px; color: var(--ttk-text-primary); text-decoration: underline; }

/* Jury */
.ttk-jury-section {
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.ttk-jury-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 24px;
}
.ttk-jury-card {
    flex: 1 0 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.ttk-jury-photo img {
    width: 120px;
    height: 119px;
    border-radius: 24px;
    object-fit: cover;
}
.ttk-jury-photo-placeholder {
    width: 120px;
    height: 119px;
    border-radius: 24px;
    background: var(--ttk-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 40px;
    color: var(--ttk-text-tertiary);
}
.ttk-jury-info { text-align: center; display: flex; flex-direction: column; gap: 2px; width: 100%; }
.ttk-jury-name { font-family: var(--ttk-font); font-weight: 700; font-size: 18px; line-height: 1.6; color: var(--ttk-text-primary); margin: 0; }
.ttk-jury-title { font-family: var(--ttk-font); font-size: 16px; color: var(--ttk-text-secondary); margin: 0; }
.ttk-jury-org { font-family: var(--ttk-font); font-size: 14px; color: var(--ttk-text-tertiary); margin: 0; }

/* CTA — sama struktuur kui inspiratsioonipäevadel */
.ttk-cta-section {
    background: var(--ttk-blue-20);
    padding: 24px 120px;
    margin-left: -120px;
    margin-right: -120px;
    overflow: hidden;
}
.ttk-cta-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) fit-content(100%) minmax(0, 1fr);
    max-width: 1200px;
    margin: 0 auto;
}
.ttk-cta-newsletter {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 48px;
    align-self: flex-start;
}
.ttk-cta-donate {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 48px;
    justify-content: center;
    align-self: stretch;
}
.ttk-cta-divider {
    width: 1px;
    background: var(--ttk-gray-300);
    align-self: stretch;
}
.ttk-cta-newsletter .ttk-cta-header { display: flex; align-items: flex-start; gap: 16px; }
.ttk-cta-donate .ttk-cta-header { display: flex; align-items: center; gap: 12px; width: 100%; }
.ttk-cta-header svg { flex-shrink: 0; }
.ttk-cta-title {
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 32px;
    line-height: 40px;
    color: #000;
    margin: 0;
    white-space: nowrap;
}
.ttk-cta-text {
    font-family: var(--ttk-font);
    font-size: 16px;
    line-height: 24px;
    color: #454854;
    margin: 0;
}
.ttk-cta-text-small { font-size: 14px; }
.ttk-newsletter-form { display: flex; flex-direction: column; }
.ttk-newsletter-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.ttk-newsletter-input {
    width: 280px;
    flex-shrink: 0;
    padding: 10px 16px !important;
    border: 1px solid #c8c8d0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    font-family: var(--ttk-font);
    font-size: 14px !important;
    line-height: 24px !important;
    color: #000;
    box-sizing: border-box;
    outline: none;
    margin: 0 !important;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s;
}
.ttk-newsletter-input::placeholder { color: #686b78; }
.ttk-newsletter-input:focus { border-color: var(--ttk-orange-100) !important; }
.ttk-newsletter-btn {
    padding: 10px 24px;
    background: var(--ttk-orange-40);
    color: #000;
    font-family: var(--ttk-font);
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}
.ttk-newsletter-btn:hover { background: var(--ttk-orange-100); color: #fff; }
.ttk-cta-donate .ttk-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 16px;
    line-height: 24px;
    border-radius: 0;
}

/* Related */
.ttk-related-section { display: flex; flex-direction: column; gap: 24px; }
.ttk-related-grid {
    display: flex;
    gap: 4px;
    align-items: flex-start;
    justify-content: flex-start;
}
.ttk-related-card {
    flex: 1 0 0;
    min-width: 0;
    max-width: calc((1200px - 8px) / 3);
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--ttk-orange-20);
    text-decoration: none;
    color: var(--ttk-text-primary);
    padding-bottom: 16px;
    transition: opacity 0.18s;
}
.ttk-related-card:hover { opacity: 0.88; text-decoration: none; color: var(--ttk-text-primary); }
.ttk-related-card-img { height: 200px; width: 100%; flex-shrink: 0; overflow: hidden; position: relative; }
.ttk-related-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.ttk-related-card-img-empty { width: 100%; height: 100%; background: var(--ttk-gray-300); }
.ttk-related-card-text { display: flex; align-items: center; padding: 0 16px; }
.ttk-related-card-text p {
    flex: 1;
    font-family: var(--ttk-font);
    font-size: 16px;
    line-height: 24px;
    color: var(--ttk-text-primary);
    margin: 0;
    height: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Admin hint */
.ttk-admin-hint { margin-top: 8px; }
.ttk-fe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ttk-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--ttk-orange-100);
    background: rgba(244,197,143,0.15);
    border: 1px solid var(--ttk-orange-40);
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s;
}
.ttk-fe-btn:hover { background: var(--ttk-orange-40); color: var(--ttk-text-primary); text-decoration: none; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .ttk-single-hero, .ttk-single-main { padding-left: 20px; padding-right: 20px; }
    .ttk-single-content-wrap { flex-direction: column; }
    .ttk-single-sidebar { width: 100%; }
    .ttk-single-hero-img { height: 220px; }
    .ttk-single-title { font-size: 32px; }
    .ttk-hero-upcoming { flex-direction: column; }
    .ttk-hero-image { width: 100%; height: 220px; }
    .ttk-hero-details { padding: 24px; }
    .ttk-about-content { flex-direction: column; }
    .ttk-testimonial { width: 100%; }
    .ttk-voitatood-grid { grid-template-columns: repeat(2, 1fr); }
    .ttk-list-view { gap: 32px; }
    .ttk-cta-section { padding: 0; margin-left: 0; margin-right: 0; }
    .ttk-cta-inner { grid-template-columns: 1fr; }
    .ttk-cta-divider { width: 100%; height: 1px; align-self: auto; }
    .ttk-cta-newsletter, .ttk-cta-donate { padding: 32px 24px; align-self: auto; align-items: center; }
    .ttk-cta-newsletter .ttk-cta-header, .ttk-cta-donate .ttk-cta-header { flex-direction: column; align-items: center; }
    .ttk-cta-title { font-size: 24px; line-height: 32px; text-align: center; }
    .ttk-cta-text { text-align: center; }
    .ttk-newsletter-input { width: 0; flex: 1; min-width: 0; }
    .ttk-related-grid { flex-direction: column; }
    .ttk-related-card { max-width: 100%; }
    .ttk-h2 { font-size: 28px; line-height: 36px; }
}

@media (max-width: 600px) {
    .ttk-voitatood-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .ttk-list-item { grid-template-columns: 70px 1fr auto; }
    .ttk-list-item-cover { width: 70px; height: 54px; }
    .ttk-jury-card { min-width: 140px; }
    .ttk-jury-grid { gap: 24px; }
}
