/* =================================================
   Custom styles for Indiraneelan Suresh author site
   ================================================= */

/* --- Navigation --- */
.site-nav {
    margin-top: 1.5em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}

.site-nav a {
    display: inline-block;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.82em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.5em 1em;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
}

.site-nav a.active {
    color: #fff;
    background: rgba(181, 69, 27, 0.8);
    border-color: transparent;
}

/* --- Footer visibility (overrides main.css faint defaults) --- */
#footer .icons a {
    color: rgba(255, 255, 255, 0.82);
    transition: color 0.2s;
}

#footer .icons a:hover {
    color: #fff;
}

#footer .copyright {
    color: rgba(255, 255, 255, 0.72);
}

#footer .copyright li {
    border-left-color: rgba(255, 255, 255, 0.4);
}

#footer .copyright a {
    color: rgba(255, 255, 255, 0.82);
}

/* Mobile footer matches sidebar color */
@media screen and (max-width: 980px) {
    #footer {
        background-color: #0d1b2a;
        background-image: none;
    }
}

/* --- Section dividers in content area — warm tint --- */
#main > section {
    border-top-color: #e8e0d8;
}

/* --- Global content text colors --- */
#main p,
#main li,
#main a {
    color: #444;
}

#main p {
    line-height: 1.75;
}

#main h2,
#main h3,
#main h4,
#main h5,
#main h6 {
    color: #222;
}

#main a {
    color: #b5451b;
    text-decoration: none;
    border-bottom: 1px solid rgba(181, 69, 27, 0.3);
    transition: color 0.2s, border-color 0.2s;
}

#main a:hover {
    color: #8a3010;
    border-bottom-color: rgba(138, 48, 16, 0.5);
}

/* --- Left sidebar: color (all screen sizes) --- */
#header {
    background-color: #0d1b2a;
    background-image: none;
}

/* --- Left sidebar: avatar, text, nav (all screen sizes) --- */
#header > .inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#header .image.avatar {
    width: 8em;
    margin: 0 0 1.25em 0;
}

#header .image.avatar img {
    border-radius: 50%;
    width: 100%;
    height: auto;
    filter: contrast(1.12) brightness(1.04) saturate(1.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 4px 20px rgba(0, 0, 0, 0.5);
}

#header h1 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2em;
    line-height: 1.4;
    margin: 0 0 0.15em 0;
}

#header .tamil-name {
    font-size: 1.05em;
    color: rgba(255, 255, 255, 0.72);
    margin: 0.1em 0 0.5em 0;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.03em;
}

#header h1:last-of-type,
#header h1[lang] {
    font-size: 0.85em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0;
}

#header h1[lang="en"] {
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-nav {
    justify-content: center;
}

/* --- Desktop sidebar: width, padding, positioning --- */
@media screen and (min-width: 981px) {
    #header {
        width: 26%;
        padding: 5em 2.5em;
        text-align: center;
        align-items: center;
    }
    #main {
        margin-left: 26%;
        width: calc(100% - 26%);
        padding-top: 3em;
    }
}

@media screen and (min-width: 981px) and (max-width: 1280px) {
    #header {
        width: 24%;
        padding: 4em 2em;
    }
    #main {
        margin-left: 24%;
        width: calc(100% - 24%);
        padding: 3em 3em 3em 3em;
    }
}

/* --- Mobile sidebar tweaks --- */
@media screen and (max-width: 980px) {
    #header .image.avatar {
        width: 6.5em;
    }
    #header h1 {
        font-size: 1.5em;
    }
    #header .tamil-name {
        font-size: 1em;
    }
    .site-nav {
        margin-top: 1.2em;
    }
}

/* --- Header typography --- */
#header .inner h1 {
    line-height: 1.3;
    margin-bottom: 0.2em;
}

/* --- Section headings --- */
#main section > h2 {
    font-size: 1.35em;
    color: #222;
    padding-bottom: 0.5em;
    margin-bottom: 1.25em;
    border-bottom: 2px solid #b5451b;
    display: inline-block;
}

#main section > header.major > h2 {
    border-bottom: none;
}

/* --- Books grid --- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75em;
    margin-top: 0.25em;
    margin-bottom: 0.5em;
}

.book-card {
    text-align: center;
}

.book-card a {
    display: block;
    text-decoration: none;
}

.book-card img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-card a:hover img {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.book-card h3 {
    margin-top: 0.8em;
    margin-bottom: 0.2em;
    font-size: 0.95em;
    color: #222;
    line-height: 1.4;
}

.book-card p {
    font-size: 0.8em;
    color: #666;
    margin: 0;
}

@media screen and (max-width: 736px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Selected work image cards --- */
.work-item h3 {
    font-size: 0.9em;
    margin-top: 0.6em;
    margin-bottom: 0.15em;
    line-height: 1.35;
}

.work-item p {
    font-size: 0.78em;
    color: #666;
    margin: 0 0 0.5em;
}

/* --- View all link --- */
.view-all-link {
    display: inline-block;
    margin-top: 1.25em;
    font-size: 0.88em;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #b5451b;
    text-decoration: none;
    border-bottom: 1px solid rgba(181, 69, 27, 0.4);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.view-all-link:hover {
    color: #8a3010;
    border-color: rgba(138, 48, 16, 0.6);
}

/* --- Styled lists (awards, editorial roles, prizes) --- */
.styled-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1em;
}

.styled-list li {
    position: relative;
    padding: 0.7em 0 0.7em 1.4em;
    border-bottom: 1px solid #eeeeee;
    font-size: 0.93em;
    line-height: 1.65;
    color: #444;
}

.styled-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.15em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #b5451b;
}

.styled-list li:last-child {
    border-bottom: none;
}

/* --- Works list (dense, for works.html) --- */
.works-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1em;
}

.works-list li {
    position: relative;
    padding: 0.55em 0 0.55em 1.2em;
    border-bottom: 1px solid #f2f2f2;
    font-size: 0.9em;
    line-height: 1.6;
    color: #444;
}

.works-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.05em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #b5451b;
}

.works-list li:last-child {
    border-bottom: none;
}

/* --- Gallery slideshow --- */
.slideshow {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #111;
    aspect-ratio: 16 / 9;
}

.slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.38);
    color: #fff;
    border: none;
    font-size: 1.3em;
    width: 2.4em;
    height: 2.4em;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.slide-btn:hover {
    background: rgba(181, 69, 27, 0.75);
}

.slide-prev { left: 0.75em; }
.slide-next { right: 0.75em; }

.slide-dots {
    position: absolute;
    bottom: 0.75em;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.45em;
    z-index: 10;
}

.slide-dots .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.slide-dots .dot.active {
    background: #fff;
    transform: scale(1.25);
}

@media screen and (max-width: 736px) {
    .slideshow {
        aspect-ratio: 4 / 3;
        border-radius: 4px;
    }
    .slide-btn {
        font-size: 1em;
        width: 2em;
        height: 2em;
    }
}

/* --- Language toggle --- */
.lang-toggle {
    display: flex;
    gap: 0.4em;
    margin-top: 1.2em;
    justify-content: center;
}

.lang-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.35em 0.85em;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}

.lang-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.lang-btn.active {
    background: rgba(181, 69, 27, 0.85);
    border-color: transparent;
    color: #fff;
}
