/* Oasis Awaiters — peacock palette
   Ivory page, deep-green frame, midnight-blue headings, emerald and deep blue accents,
   gold reserved for small accents (trim, rules, highlights). */
:root {
    --ivory: #FBF8F1;
    --white: #FFFFFF;
    --midnight: #0C1E3A;        /* headings */
    --forest: #0F3A2E;          /* deep green: header, footer, buttons */
    --forest-deep: #0A2A21;
    --blue: #1D3B6E;            /* deep peacock blue */
    --teal: #0F6B78;            /* peacock teal */
    --emerald: #17694F;         /* links, labels */
    --emerald-dark: #105040;
    --gold: #B8892B;            /* accent: trim, rules, highlights */
    --gold-deep: #8A6219;       /* gold that is readable on ivory */
    --gold-light: #E2C06B;      /* gold on midnight */
    --line: #E6D9B8;            /* warm hairline */
    --text: #1F2A3C;
    --text-muted: #4A5568;
    --on-dark: #F3F1EA;
    --on-dark-muted: #B9C9C0;
    --danger: #B42318;
}

html { scroll-behavior: smooth; }

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

body {
    background-color: var(--ivory);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--emerald); }
a:hover { color: var(--emerald-dark); }

.container {
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header: prominent centered title, menu beneath, feather-eye band */
header {
    background-color: var(--forest);
    padding: 30px 0 0;
    position: relative;
}

header::after {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg,
        var(--blue) 0 34%, var(--teal) 34% 56%, var(--emerald) 56% 78%, var(--gold) 78% 100%);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding-bottom: 16px;
}

.brand-link {
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-mark {
    width: 116px;
    height: 116px;
    flex-shrink: 0;
}

.logo-text {
    font-family: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
    font-size: 3.1rem;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--on-dark);
    white-space: nowrap;
    display: inline-block;
}

.logo-text::after {
    content: "";
    display: block;
    width: 72px;
    height: 2px;
    margin: 12px auto 0;
    background: var(--gold);
}

nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 26px;
}

nav a {
    color: var(--on-dark-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

nav a:hover {
    color: var(--on-dark);
}

nav a.active {
    color: var(--on-dark);
    border-bottom-color: var(--gold);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--on-dark-muted);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.dropdown:hover .dropdown-btn {
    color: var(--on-dark);
}

.dropdown-btn.active {
    color: var(--on-dark);
    border-bottom-color: var(--gold);
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    background-color: var(--white);
    min-width: 210px;
    box-shadow: 0 10px 24px rgba(12, 30, 58, 0.18);
    border: 1px solid var(--line);
    border-top: 2px solid var(--gold);
    z-index: 200;
    padding: 6px 0;
}

.dropdown-content a {
    color: var(--text);
    padding: 10px 18px;
    display: block;
    font-size: 0.9rem;
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--ivory);
    color: var(--emerald);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
}

/* Title lockup: the logo stays whole; "ASIS" sits beside its O, "WAITERS" beside its mountain A */
.brand-link.lockup {
    display: flex;
    align-items: flex-start;
    gap: 0;
    font-size: 3rem;
    margin-bottom: 6px;
}
.lockup-mark {
    display: block;
    height: 2.13em;
    width: 2.13em;
    flex-shrink: 0;
}
.lockup-text {
    position: relative;
    height: 2.13em;
    margin-left: -0.238em;      /* start just right of the mountain's right leg */
    font-family: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--on-dark);
    line-height: 1;
    white-space: nowrap;
    text-align: left;
}
.lk-asis {                                    /* beside the O, centred on the ring */
    position: absolute;
    left: 0.112em;
    top: 0.478em;
}
.lk-waiters {                                 /* beside the A, sitting on the legs' baseline */
    display: block;
    padding-top: 1.269em;
}

/* Page content */
.page-view {
    animation: fadeIn 0.3s ease-in-out;
}

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

.hero {
    padding: 64px 0 48px;
    border-bottom: 1px solid var(--line);
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--midnight);
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.hero p.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 860px;
    line-height: 1.7;
}

section {
    padding: 52px 0;
    border-bottom: 1px solid var(--line);
}

section:last-child {
    border-bottom: none;
}

section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--midnight);
    margin-bottom: 26px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

section h2::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    margin-top: 12px;
    background: var(--line);
}

section > p {
    margin-bottom: 16px;
    max-width: 860px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

/* Cards: white with a warm hairline and a thin peacock-colored top edge */
.card {
    background-color: var(--white);
    border: 1px solid var(--line);
    border-top: 3px solid var(--emerald);
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.grid > .card:nth-child(3n+2) { border-top-color: var(--blue); }
.grid > .card:nth-child(3n+3) { border-top-color: var(--teal); }

.card h3 {
    color: var(--midnight);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.65;
    margin-bottom: 14px;
}

.badge {
    display: inline-block;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--emerald);
    margin-bottom: 10px;
    width: fit-content;
}

/* Panels (organization details, notes) */
.org-details {
    background-color: var(--white);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    padding: 32px;
}

.org-details h3 {
    color: var(--midnight);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
}

.detail-item h4 {
    color: var(--gold-deep);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    font-weight: 600;
}

.detail-item p {
    color: var(--text);
    font-size: 0.95rem;
    white-space: pre-line;
}

/* Text helpers (replacing old inline colors) */
.text-strong { color: var(--midnight); }
.text-muted { color: var(--text-muted); }

/* Bios and lists */
.bio { margin-bottom: 36px; max-width: 860px; }
.bio h3 { color: var(--midnight); font-size: 1.12rem; margin-bottom: 10px; }
.bio p { margin-bottom: 12px; }
.bio ul, .plain-list { margin: 0 0 12px 22px; }
.plain-list li, .bio li { margin-bottom: 6px; }
.plain-list li::marker, .bio li::marker { color: var(--gold); }
.plain-list.columns { columns: 2 300px; }

/* Uniform card grids: every card in the grid is the same height */
.grid.uniform { grid-auto-rows: 1fr; }
.clamp-1, .clamp-2, .clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-4 { -webkit-line-clamp: 4; line-clamp: 4; }
.card-more { align-self: flex-start; margin-top: 4px; font-size: 0.9rem; }

/* Detail pop-up */
.detail-dialog {
    margin: auto;
    width: min(680px, calc(100% - 32px));
    max-height: calc(100vh - 64px);
    padding: 34px 34px 28px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--emerald);
    background: var(--white);
    color: var(--text);
    box-shadow: 0 20px 50px rgba(12, 30, 58, 0.25);
}
.detail-dialog::backdrop { background: rgba(10, 42, 33, 0.55); }
.detail-dialog h3 { color: var(--midnight); font-size: 1.35rem; margin-bottom: 10px; line-height: 1.3; }
.detail-dialog p { color: var(--text-muted); margin-bottom: 10px; }
.detail-dialog h4 { color: var(--gold-deep); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 18px 0 6px; }
.detail-dialog ul { margin: 0 0 8px 20px; color: var(--text-muted); }
.detail-dialog li { margin-bottom: 4px; }
.detail-dialog li::marker { color: var(--gold); }
.dialog-cta { margin-top: 22px !important; }
.dialog-close {
    position: absolute; top: 10px; right: 14px;
    background: none; border: none; font-size: 1.8rem; line-height: 1;
    color: var(--text-muted); cursor: pointer;
}
.dialog-close:hover { color: var(--midnight); }

/* Expandable publication list (About page) */
.pub-list { margin: 4px 0 14px; }
.pub-list summary {
    display: inline-block;
    list-style: none;
    color: var(--emerald);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.pub-list summary::-webkit-details-marker { display: none; }
.pub-list summary::after { content: " \25BE"; text-decoration: none; display: inline-block; margin-left: 4px; }
.pub-list[open] summary::after { content: " \25B4"; }
.pub-list .when-open, .pub-list[open] .when-closed { display: none; }
.pub-list[open] .when-open { display: inline; }
.pub-list ul { margin: 12px 0 0 22px; }

/* Course details */
details { margin-top: 4px; }
details summary { color: var(--emerald); cursor: pointer; font-size: 0.9rem; font-weight: 600; }
details h4 { color: var(--gold-deep); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 14px 0 6px; }
details ul { margin: 0 0 8px 20px; color: var(--text-muted); font-size: 0.9rem; }
details p { margin-bottom: 6px !important; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--midnight);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--white);
    border: 1px solid #D8CCAE;
    border-radius: 3px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(23, 105, 79, 0.15);
}

.btn {
    display: inline-block;
    background-color: var(--forest);
    color: var(--on-dark);
    padding: 12px 24px;
    border: none;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
    text-align: center;
}

.btn:hover {
    background-color: var(--blue);
    color: var(--white);
}

.btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-inline {
    background: none;
    border: none;
    color: var(--emerald);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    padding: 0;
}

a.btn-inline { display: inline; }

/* Book search & filter */
.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 240px;
}

/* Book covers */
.book-card { justify-content: flex-start; }
.book-cover {
    height: 240px;
    margin: -26px -26px 20px;            /* run edge to edge across the top of the card */
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 0;
}
.book-cover img {
    height: 100%;
    width: auto;
    max-width: 80%;
    object-fit: contain;
    box-shadow: 0 6px 16px rgba(12, 30, 58, 0.18);
}

/* Arabic verse */
.verse {
    font-size: 1.8rem;
    color: var(--gold-deep);
    line-height: 1.9;
    margin-bottom: 18px;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 32px 0;
    color: var(--on-dark-muted);
    font-size: 0.82rem;
    background-color: var(--forest);
    border-top: 2px solid var(--gold);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 768px) {
    header { padding-top: 22px; }
    .logo-text { font-size: 1.75rem; letter-spacing: 0.06em; }
    .logo-mark { width: 64px; height: 64px; }
    .brand-link.lockup { font-size: 1.9rem; }
    .brand-link { gap: 10px; }
    nav { gap: 6px 18px; }
    .hero { padding: 44px 0 36px; }
    .hero h1 { font-size: 1.8rem; }
    .grid { grid-template-columns: 1fr !important; }
}
