/* Tufte-inspired CSS for Architecture Library Collection */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: "ET Book", Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    background-color: #f8f8f8;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #222;
}

h2 {
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: #333;
}

h3 {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    margin-bottom: 3rem;
    text-align: center;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 4rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2rem;
}

/* Navigation */
.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1px;
}

.breadcrumb a:hover {
    color: #333;
    border-bottom-color: #333;
}

/* Back link */
.back-link {
    display: inline-block;
    color: #666;
    text-decoration: none;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2px;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: #333;
    border-bottom-color: #333;
}

/* Library Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.library-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    transition: all 0.3s ease;
}

.library-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.library-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.library-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.library-image-placeholder {
    width: 100%;
    height: 250px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

.library-info {
    padding: 1.5rem;
}

.library-info h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.library-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align: left;
}

.location {
    color: #666;
    font-style: italic;
    text-align: center;
}

.category {
    color: #888;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.architecture {
    color: #555;
}

.architect {
    color: #777;
    font-style: italic;
}

/* Library Detail Page */
.library-detail {
    max-width: 800px;
    margin: 0 auto;
}

.library-header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2rem;
}

.library-header h1 {
    margin-bottom: 0.5rem;
}

.library-header .location {
    font-size: 1.1rem;
    color: #666;
}

.library-content {
    display: grid;
    gap: 3rem;
}

/* Photos */
.library-photos {
    text-align: center;
}

.main-photo {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin-bottom: 1rem;
    border: 1px solid #e6e6e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-photo {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border: 1px solid #e6e6e6;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.gallery-photo:hover {
    opacity: 1;
}

/* Info Grid */
.info-grid {
    display: grid;
    gap: 1rem;
    border: 1px solid gray;
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item dt {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    align-self: start;
}

.info-item dd {
    color: #333;
    line-height: 1.5;
}

.info-item dd a {
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

.info-item dd a:hover {
    color: #333;
    border-bottom-color: #333;
}

/* External Links */
.external-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.external-link {
    margin: 0;
}

.external-link a {
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.external-link a:hover {
    color: #333;
    border-bottom-color: #333;
}

/* Location Info */
.location-info {
    background: #fff;
    padding: 2rem;
    border: 1px solid #e6e6e6;
    margin-top: 2rem;
}

.address, .phone {
    margin-bottom: 1rem;
    text-align: left;
}

.opening-hours {
    margin-bottom: 1rem;
}

.opening-hours ul {
    list-style: none;
    margin-top: 0.5rem;
}

.opening-hours li {
    padding: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* Map Section */
.map-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid #ddd;
    text-align: center;
}

.map-section h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

#map {
    height: 500px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .library-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .library-info {
        padding: 1rem;
    }
    
    .location-info {
        padding: 1.5rem;
    }
    
    #map {
        height: 300px;
    }
}

/* Responsive map */
@media (max-width: 768px) {
    #map {
        height: 400px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .library-card {
        break-inside: avoid;
        border: 1pt solid #ccc;
        margin-bottom: 1rem;
    }
    
    .library-image,
    .main-photo,
    .photo-gallery {
        display: none;
    }
}