/* darashty.co.il - styles.css
 * סגנונות מאוחדים לאתר שיעורי הרב איתן כהן שליט"א
 * מבוסס על העיצוב המקורי של האתר, מותאם למבנה החדש
 */

/* ===== CSS Variables ===== */
:root {
    /* צבעים - שמורים מהאתר המקורי */
    --primary-color: #012E4A;
    --secondary-color: #036280;
    --header-color: #053959;
    --background-color: #E8EDE7;
    --text-color: #012E4A;
    --sidebar-bg: #F2F5F0;
    --transcript-bg: #F7F9F5;
    --hover-color: #81BECE;
    --accent-color: #475569;
    --focus-color: #0066cc;

    /* מידות */
    --container-max: 1100px;
    --content-max: 800px;
    --border-radius: 12px;
    --header-padding: 20px;
    --section-spacing: 32px;

    /* צללים */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);

    /* מעברים */
    --transition: 0.25s ease;
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Base ===== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Assistant', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.65;
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

a:hover, a:focus {
    color: var(--hover-color);
}

a:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
    border-radius: 4px;
}

ul, ol {
    list-style-type: none;
}

/* ===== Header ===== */
.site-header {
    background-color: var(--header-color);
    color: white;
    padding: var(--header-padding);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.site-header .header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.logo-link {
    display: inline-block;
    border-radius: 50%;
    transition: transform var(--transition);
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-link img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.site-title {
    font-family: 'Heebo', 'Assistant', sans-serif;
    font-size: clamp(1.3em, 2.5vw, 1.8em);
    font-weight: 700;
    margin: 0;
    color: white;
}

.site-subtitle {
    font-size: clamp(0.95em, 1.5vw, 1.05em);
    font-weight: 300;
    color: rgba(255,255,255,0.92);
    max-width: 700px;
    margin: 0 auto;
}

.header-nav {
    margin-top: 4px;
}

.header-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 14px;
}

.header-nav a {
    color: rgba(255,255,255,0.92);
    font-size: 0.95em;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background var(--transition);
}

.header-nav a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.header-nav .separator {
    color: rgba(255,255,255,0.4);
    user-select: none;
}

/* ===== Main Layout ===== */
main.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 24px var(--header-padding);
    flex: 1;
    width: 100%;
}

/* ===== Home Page (רשימת שיעורים) ===== */
.shiurim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.shiur-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 4px solid var(--secondary-color);
}

.shiur-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.shiur-card .shiur-number {
    font-size: 0.85em;
    color: var(--accent-color);
    font-weight: 600;
}

.shiur-card .shiur-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.25em;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
    margin: 4px 0;
}

.shiur-card .shiur-description {
    font-size: 0.95em;
    color: var(--accent-color);
    line-height: 1.5;
    flex: 1;
}

.shiur-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.shiur-card a::after {
    content: 'לצפייה בשיעור ←';
    display: block;
    margin-top: 12px;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95em;
}

.search-container {
    margin: 24px 0 8px;
}

.search-container input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(1, 46, 74, 0.15);
    border-radius: var(--border-radius);
    font-size: 1.05em;
    font-family: inherit;
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-container input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(3, 98, 128, 0.15);
}

/* תוצאות חיפוש */
.search-result-count {
    margin-top: 8px;
    font-size: 0.92em;
    color: var(--accent-color);
    padding: 0 4px;
}

.search-snippet {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(3, 98, 128, 0.06);
    border-right: 3px solid var(--secondary-color);
    border-radius: 6px;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 0.92em;
    line-height: 1.5;
    color: var(--text-color);
}

.search-snippet mark {
    background: rgba(255, 235, 59, 0.5);
    color: inherit;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Shiur Page ===== */
.shiur-page {
    max-width: var(--content-max);
    margin: 0 auto;
}

.breadcrumbs {
    margin-bottom: 16px;
    font-size: 0.92em;
    color: var(--accent-color);
}

.breadcrumbs a {
    color: var(--accent-color);
}

.shiur-header {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.shiur-header .shiur-meta {
    font-size: 0.9em;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.shiur-header h1 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: clamp(1.5em, 3.5vw, 2em);
    color: var(--primary-color);
    line-height: 1.25;
    margin-bottom: 10px;
}

.shiur-header .shiur-subtitle {
    font-size: 1.05em;
    color: var(--secondary-color);
    margin-bottom: 16px;
}

.shiur-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--transcript-bg);
    color: var(--primary-color);
    border: 1px solid rgba(1, 46, 74, 0.15);
}

.btn-secondary:hover {
    background: var(--sidebar-bg);
    color: var(--primary-color);
}

/* Video player */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: black;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Transcript */
.transcript-container {
    background-color: var(--transcript-bg);
    padding: 28px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.transcript-container h1,
.transcript-container h2,
.transcript-container h3,
.transcript-container h4,
.transcript-container h5,
.transcript-container h6 {
    font-family: 'Assistant', sans-serif;
    color: var(--primary-color);
    margin-top: 1.4em;
    margin-bottom: 0.6em;
    line-height: 1.3;
}

.transcript-container > h1:first-child,
.transcript-container > h2:first-child,
.transcript-container > h3:first-child,
.transcript-container > h4:first-child {
    margin-top: 0;
}

.transcript-container h1 { font-size: 1.6em; font-weight: 700; }
.transcript-container h2 { font-size: 1.4em; font-weight: 600; }
.transcript-container h3 { font-size: 1.25em; font-weight: 600; color: var(--secondary-color); }
.transcript-container h4 {
    font-size: 1.15em;
    font-weight: 600;
    border-bottom: 2px solid rgba(3, 98, 128, 0.2);
    padding-bottom: 6px;
    margin-top: 1.6em;
}

.transcript-container p {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.05em;
    font-weight: 400;
    line-height: 1.85;
    margin-bottom: 1em;
    text-align: justify;
}

.transcript-container p strong {
    font-weight: 700;
    color: var(--primary-color);
}

.transcript-container ol, .transcript-container ul {
    padding-right: 24px;
    margin: 1em 0;
}

.transcript-container ol li, .transcript-container ul li {
    list-style: revert;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 0.5em;
}

/* תצוגת PDF */
.pdf-viewer {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 80vh;
    min-height: 500px;
    margin-bottom: 24px;
}

.pdf-viewer object {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-fallback {
    padding: 60px 24px;
    text-align: center;
    color: var(--accent-color);
}

.pdf-fallback p {
    margin-bottom: 20px;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.1em;
}

@media (max-width: 640px) {
    .pdf-viewer { height: 60vh; min-height: 400px; }
}

/* No transcript notice */
.no-transcript-notice {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--accent-color);
    font-style: italic;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--header-color);
    color: rgba(255,255,255,0.85);
    padding: 24px 16px;
    text-align: center;
    margin-top: auto;
    font-size: 0.92em;
}

.site-footer a {
    color: rgba(255,255,255,0.95);
    margin: 0 4px;
}

.site-footer a:hover {
    color: white;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .header-padding { padding: 14px; }
    main.container { padding: 16px 12px; }
    .shiur-header { padding: 18px; }
    .transcript-container { padding: 18px; }
    .shiurim-grid { grid-template-columns: 1fr; }
}

/* ===== Print ===== */
@media print {
    .site-header, .site-footer, .shiur-actions, .video-wrapper, .breadcrumbs {
        display: none;
    }
    body { background: white; }
    .transcript-container, .shiur-header {
        box-shadow: none;
        background: white;
        border: 1px solid #ddd;
    }
}
